webnaplo-gulbaba-api/src/App/Action/MaintenanceUpcomingAction.php

38 lines
995 B
PHP
Raw Normal View History

2018-11-11 12:01:18 +01:00
<?php
namespace App\Action;
use App\Response\JsonCorsResponse;
use App\Service\MaintenanceManagerService;
use Interop\Http\ServerMiddleware\DelegateInterface;
use Psr\Http\Message\ServerRequestInterface;
class MaintenanceUpcomingAction extends AbstractCrudAction
{
const CORS_ALLOW_METHODS = [
'GET',
];
/**
* @var MaintenanceManagerService
*/
private $maintenanceManagerService;
public function __construct(MaintenanceManagerService $maintenanceManagerService)
{
$this->maintenanceManagerService = $maintenanceManagerService;
}
/**
* Renew auth token
*
* @param ServerRequestInterface $request
* @param DelegateInterface $delegate
* @return \Zend\Diactoros\Response\JsonResponse
*/
public function getList(ServerRequestInterface $request, DelegateInterface $delegate)
{
return new JsonCorsResponse($this->maintenanceManagerService->getUpcomingMaintenanceList()->getValues());
}
}