Implemented draft

This commit is contained in:
Kevin Frantz 2019-02-26 17:31:12 +01:00
parent 4485091813
commit 0b6570b4f8

View File

@ -9,6 +9,7 @@ use Infinito\Controller\API\AbstractAPIController;
use Infinito\Domain\RequestManagement\Action\RequestedActionServiceInterface; use Infinito\Domain\RequestManagement\Action\RequestedActionServiceInterface;
use Infinito\Domain\MVCManagement\MVCRoutineServiceInterface; use Infinito\Domain\MVCManagement\MVCRoutineServiceInterface;
use Infinito\DBAL\Types\ActionType; use Infinito\DBAL\Types\ActionType;
use Infinito\Attribut\ClassAttributInterface;
/** /**
* @author kevinfrantz * @author kevinfrantz
@ -30,12 +31,15 @@ final class LayerController extends AbstractAPIController
* ".{_format}", * ".{_format}",
* methods={"GET","POST"} * methods={"GET","POST"}
* ) * )
* {@inheritdoc} * @todo Mayber create an own controller for sources, because they have some special logic!
*
* @see \Infinito\Controller\API\AbstractAPIController::read()
*/ */
public function create(MVCRoutineServiceInterface $mvcRoutineService, RequestedActionServiceInterface $requestedActionService, string $layer, $identity): Response public function create(Request $request,MVCRoutineServiceInterface $mvcRoutineService, RequestedActionServiceInterface $requestedActionService, string $layer): Response
{ {
//Not implemented yet in MVC routine. This is just a draft!
if($request->query->has(ClassAttributInterface::CLASS_ATTRIBUT_NAME)){
$class = $request->query->get(ClassAttributInterface::CLASS_ATTRIBUT_NAME);
$requestedActionService->getRequestedEntity()->setClass($class);
}
$requestedActionService->setActionType(ActionType::CREATE); $requestedActionService->setActionType(ActionType::CREATE);
$requestedActionService->setLayer($layer); $requestedActionService->setLayer($layer);
$view = $mvcRoutineService->process(); $view = $mvcRoutineService->process();
@ -48,9 +52,6 @@ final class LayerController extends AbstractAPIController
* "/{identity}.{_format}", * "/{identity}.{_format}",
* methods={"GET"} * methods={"GET"}
* ) * )
* {@inheritdoc}
*
* @see \Infinito\Controller\API\AbstractAPIController::read()
*/ */
public function read(MVCRoutineServiceInterface $mvcRoutineService, RequestedActionServiceInterface $requestedActionService, string $layer, $identity): Response public function read(MVCRoutineServiceInterface $mvcRoutineService, RequestedActionServiceInterface $requestedActionService, string $layer, $identity): Response
{ {