mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2025-09-13 13:57:10 +02:00
Refactored ActionManagement
This commit is contained in:
Binary file not shown.
File diff suppressed because it is too large
Load Diff
After Width: | Height: | Size: 187 KiB |
@@ -11,14 +11,14 @@ namespace Infinito\Domain\ActionManagement;
|
||||
abstract class AbstractActionConstructor
|
||||
{
|
||||
/**
|
||||
* @var ActionServiceInterface
|
||||
* @var ActionDAOServiceInterface
|
||||
*/
|
||||
protected $actionService;
|
||||
|
||||
/**
|
||||
* @param ActionServiceInterface $actionService
|
||||
* @param ActionDAOServiceInterface $actionService
|
||||
*/
|
||||
final public function __construct(ActionServiceInterface $actionService)
|
||||
final public function __construct(ActionDAOServiceInterface $actionService)
|
||||
{
|
||||
$this->actionService = $actionService;
|
||||
}
|
||||
|
@@ -16,10 +16,10 @@ use Infinito\Domain\SecureManagement\SecureRequestedRightCheckerServiceInterface
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
*/
|
||||
final class ActionService implements ActionServiceInterface
|
||||
final class ActionDAOService implements ActionDAOServiceInterface
|
||||
{
|
||||
/**
|
||||
* @var Request
|
||||
* @var RequestStack
|
||||
*/
|
||||
private $requestStack;
|
||||
|
||||
@@ -64,7 +64,7 @@ final class ActionService implements ActionServiceInterface
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @see \Infinito\Domain\ActionManagement\ActionServiceInterface::getRequestedAction()
|
||||
* @see \Infinito\Domain\ActionManagement\ActionDAOServiceInterface::getRequestedAction()
|
||||
*/
|
||||
public function getRequestedAction(): RequestedActionInterface
|
||||
{
|
||||
@@ -74,7 +74,7 @@ final class ActionService implements ActionServiceInterface
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @see \Infinito\Domain\ActionManagement\ActionServiceInterface::isRequestedActionSecure()
|
||||
* @see \Infinito\Domain\ActionManagement\ActionDAOServiceInterface::isRequestedActionSecure()
|
||||
*/
|
||||
public function isRequestedActionSecure(): bool
|
||||
{
|
||||
@@ -92,7 +92,7 @@ final class ActionService implements ActionServiceInterface
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @see \Infinito\Domain\ActionManagement\ActionServiceInterface::getRequest()
|
||||
* @see \Infinito\Domain\ActionManagement\ActionDAOServiceInterface::getRequest()
|
||||
*/
|
||||
public function getRequest(): Request
|
||||
{
|
||||
@@ -100,9 +100,9 @@ final class ActionService implements ActionServiceInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* {@use Infinito\Domain\RepositoryManagement\LayerRepositoryFactoryServiceInterface;inheritDoc}.
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @see \Infinito\Domain\ActionManagement\ActionServiceInterface::getRepository()
|
||||
* @see \Infinito\Domain\ActionManagement\ActionDAOServiceInterface::getRepository()
|
||||
*/
|
||||
public function getRepository(): RepositoryInterface
|
||||
{
|
||||
@@ -114,7 +114,7 @@ final class ActionService implements ActionServiceInterface
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @see \Infinito\Domain\ActionManagement\ActionServiceInterface::getEntityManager()
|
||||
* @see \Infinito\Domain\ActionManagement\ActionDAOServiceInterface::getEntityManager()
|
||||
*/
|
||||
public function getEntityManager(): EntityManagerInterface
|
||||
{
|
@@ -13,7 +13,7 @@ use Doctrine\ORM\EntityManagerInterface;
|
||||
*
|
||||
* @author kevinfrantz
|
||||
*/
|
||||
interface ActionServiceInterface
|
||||
interface ActionDAOServiceInterface
|
||||
{
|
||||
/**
|
||||
* @return RequestedActionInterface Returns the requested action
|
@@ -0,0 +1,3 @@
|
||||
# ActionManagement
|
||||
## Brainstorming
|
||||

|
@@ -43,10 +43,13 @@ final class ProcessService implements ProcessServiceInterface
|
||||
/**
|
||||
* @return bool True if the the entity exist
|
||||
*/
|
||||
private function doesEntityExist():bool{
|
||||
private function doesEntityExist(): bool
|
||||
{
|
||||
$requestedAction = $this->requestedActionService;
|
||||
|
||||
return $requestedAction->hasRequestedEntity() && $requestedAction->getRequestedEntity()->hasIdentity();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed|null
|
||||
*
|
||||
@@ -63,10 +66,10 @@ final class ProcessService implements ProcessServiceInterface
|
||||
}
|
||||
// CREATE
|
||||
$this->requestedActionService->getRequestedEntity()->setClass(TextSource::class);
|
||||
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param ActionHandlerServiceInterface $actionHandlerService
|
||||
* @param ActionsResultsDAOServiceInterface $actionTemplateDataStore
|
||||
|
@@ -3,7 +3,6 @@
|
||||
namespace Infinito\Domain\ViewManagement;
|
||||
|
||||
use FOS\RestBundle\View\View;
|
||||
use Infinito\Domain\ActionManagement\ActionServiceInterface;
|
||||
use Infinito\Domain\ActionManagement\ActionFactoryServiceInterface;
|
||||
use Infinito\Domain\TemplateManagement\TemplateNameServiceInterface;
|
||||
use Infinito\Domain\ParameterManagement\ValidGetParameterServiceInterface;
|
||||
@@ -19,23 +18,18 @@ final class ViewBuilder implements ViewBuilderInterface
|
||||
/**
|
||||
* @var string The path to the atom entity template
|
||||
*/
|
||||
const TWIG_ENTITY_ATOM_TEMPLATE_PATH = 'entity/_entity.html.twig';
|
||||
private const TWIG_ENTITY_ATOM_TEMPLATE_PATH = 'entity/_entity.html.twig';
|
||||
|
||||
/**
|
||||
* @var string The path to the molecule entity template
|
||||
*/
|
||||
const TWIG_ENTITY_MOLECULE_TEMPLATE_PATH = 'entity/entity.html.twig';
|
||||
private const TWIG_ENTITY_MOLECULE_TEMPLATE_PATH = 'entity/entity.html.twig';
|
||||
|
||||
/**
|
||||
* @var View
|
||||
*/
|
||||
private $view;
|
||||
|
||||
/**
|
||||
* @var ActionServiceInterface
|
||||
*/
|
||||
private $actionService;
|
||||
|
||||
/**
|
||||
* @var ActionFactoryServiceInterface
|
||||
*/
|
||||
@@ -90,15 +84,13 @@ final class ViewBuilder implements ViewBuilderInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* @param ActionServiceInterface $actionService
|
||||
* @param ActionFactoryServiceInterface $actionFactoryService
|
||||
* @param TemplateNameServiceInterface $templateNameService
|
||||
* @param ValidGetParameterServiceInterface $validGetParameterService
|
||||
*/
|
||||
public function __construct(ActionServiceInterface $actionService, ActionFactoryServiceInterface $actionFactoryService, TemplateNameServiceInterface $templateNameService, ValidGetParameterServiceInterface $validGetParameterService)
|
||||
public function __construct(ActionFactoryServiceInterface $actionFactoryService, TemplateNameServiceInterface $templateNameService, ValidGetParameterServiceInterface $validGetParameterService)
|
||||
{
|
||||
$this->view = View::create();
|
||||
$this->actionService = $actionService;
|
||||
$this->templateNameService = $templateNameService;
|
||||
$this->validGetParameterService = $validGetParameterService;
|
||||
}
|
||||
|
Reference in New Issue
Block a user