Implemented read controller logic for source

This commit is contained in:
Kevin Frantz 2019-02-17 02:40:58 +01:00
parent 6083c51c2e
commit b23faaa535
2 changed files with 12 additions and 2 deletions

View File

@ -28,7 +28,7 @@ abstract class AbstractAPIController extends AbstractController
*
* @return Response
*/
abstract public function read(Request $request, $identifier): Response;
// abstract public function read(Request $request, $identifier): Response;
/**
* @param Request $request HTTP Method PUT

View File

@ -6,6 +6,10 @@ use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\HttpFoundation\Request;
use App\Controller\API\AbstractAPIController;
use App\Domain\RequestManagement\Action\RequestedActionServiceInterface;
use App\Domain\MVCManagement\MVCRoutineServiceInterface;
use App\DBAL\Types\ActionType;
use App\DBAL\Types\Meta\Right\LayerType;
/**
* @author kevinfrantz
@ -23,8 +27,14 @@ class SourceApiController extends AbstractAPIController
*
* @see \App\Controller\API\AbstractAPIController::read()
*/
public function read(Request $request, $identifier): Response
public function read(MVCRoutineServiceInterface $mvcRoutineService, RequestedActionServiceInterface $requestedActionService, $identifier): Response
{
$requestedActionService->setActionType(ActionType::READ);
$requestedActionService->setLayer(LayerType::SOURCE);
$requestedActionService->getRequestedEntity()->setIdentity($identifier);
$view = $mvcRoutineService->process();
return $this->handleView($view);
}
/**