ameliabooking
/
src
/
Application
/
Controller
/
Settings
/
FeaturesIntegrations
/
ToggleFeatureIntegrationController.php
ToggleFeatureIntegrationController.php
29 lines
| 1 | <?php |
| 2 | |
| 3 | namespace AmeliaBooking\Application\Controller\Settings\FeaturesIntegrations; |
| 4 | |
| 5 | use AmeliaBooking\Application\Commands\Settings\FeaturesIntegrations\ToggleFeatureIntegrationCommand; |
| 6 | use AmeliaBooking\Application\Controller\Controller; |
| 7 | use Slim\Http\Request; |
| 8 | |
| 9 | class ToggleFeatureIntegrationController extends Controller |
| 10 | { |
| 11 | /** |
| 12 | * Fields for user that can be received from front-end |
| 13 | * |
| 14 | * @var array |
| 15 | */ |
| 16 | protected $allowedFields = [ |
| 17 | 'code', |
| 18 | ]; |
| 19 | |
| 20 | protected function instantiateCommand(Request $request, $args) |
| 21 | { |
| 22 | $command = new ToggleFeatureIntegrationCommand($args); |
| 23 | $requestBody = $request->getParsedBody(); |
| 24 | $this->setCommandFields($command, $requestBody); |
| 25 | |
| 26 | return $command; |
| 27 | } |
| 28 | } |
| 29 |