DeleteBlockTimeController.php
1 month ago
GetBlockTimeController.php
1 month ago
GetCalendarEventsController.php
1 month ago
GetCalendarSlotAvailabilityController.php
1 month ago
GetCalendarSlotEntitiesController.php
1 month ago
GetCalendarSlotsController.php
1 month ago
ManageCalendarBlockTimeController.php
1 month ago
ManageCalendarBlockTimeController.php
37 lines
| 1 | <?php |
| 2 | |
| 3 | namespace AmeliaBooking\Application\Controller\Calendar; |
| 4 | |
| 5 | use AmeliaBooking\Application\Commands\Calendar\ManageCalendarBlockTimeCommand; |
| 6 | use AmeliaBooking\Application\Commands\Command; |
| 7 | use AmeliaBooking\Application\Controller\Controller; |
| 8 | use AmeliaVendor\Psr\Http\Message\ServerRequestInterface as Request; |
| 9 | |
| 10 | class ManageCalendarBlockTimeController extends Controller |
| 11 | { |
| 12 | public $allowedFields = [ |
| 13 | 'id', |
| 14 | 'name', |
| 15 | 'startDateTime', |
| 16 | 'endDateTime', |
| 17 | 'employeeIds' |
| 18 | ]; |
| 19 | |
| 20 | /** |
| 21 | * @param Request $request |
| 22 | * @param array $args |
| 23 | * |
| 24 | * @return Command |
| 25 | */ |
| 26 | protected function instantiateCommand(Request $request, $args): Command |
| 27 | { |
| 28 | $command = new ManageCalendarBlockTimeCommand($args); |
| 29 | |
| 30 | $requestBody = $request->getParsedBody(); |
| 31 | |
| 32 | $this->setCommandFields($command, $requestBody); |
| 33 | |
| 34 | return $command; |
| 35 | } |
| 36 | } |
| 37 |