mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2025-04-16 10:16:22 +02:00
Refactored some stuff
This commit is contained in:
parent
19e1e00199
commit
77896004b6
@ -15,7 +15,7 @@ final class CreateSourceAction extends AbstractCreateAction
|
|||||||
/**
|
/**
|
||||||
* @var string default class name, when no parameter is defined
|
* @var string default class name, when no parameter is defined
|
||||||
*/
|
*/
|
||||||
const DEFAULT_CLASS = AbstractSource::class;
|
private const DEFAULT_CLASS = AbstractSource::class;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see SourceClassInformationService
|
* @see SourceClassInformationService
|
||||||
|
@ -40,6 +40,33 @@ final class ProcessService implements ProcessServiceInterface
|
|||||||
*/
|
*/
|
||||||
private $validGetParameterService;
|
private $validGetParameterService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return bool True if the the entity exist
|
||||||
|
*/
|
||||||
|
private function doesEntityExist():bool{
|
||||||
|
$requestedAction = $this->requestedActionService;
|
||||||
|
return $requestedAction->hasRequestedEntity() && $requestedAction->getRequestedEntity()->hasIdentity();
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @return mixed|null
|
||||||
|
*
|
||||||
|
* @throws AccessDeniedException
|
||||||
|
*/
|
||||||
|
private function getResult()
|
||||||
|
{
|
||||||
|
if ($this->doesEntityExist()) {
|
||||||
|
// READ UPDATE DELETE EXECUTE
|
||||||
|
if ($this->secureRequestedRightCheckerService->check($this->requestedActionService)) {
|
||||||
|
return $this->actionHandlerService->handle();
|
||||||
|
}
|
||||||
|
throw new AccessDeniedException("The user doesn't have the permission to access this page!");
|
||||||
|
}
|
||||||
|
// CREATE
|
||||||
|
$this->requestedActionService->getRequestedEntity()->setClass(TextSource::class);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param ActionHandlerServiceInterface $actionHandlerService
|
* @param ActionHandlerServiceInterface $actionHandlerService
|
||||||
* @param ActionsResultsDAOServiceInterface $actionTemplateDataStore
|
* @param ActionsResultsDAOServiceInterface $actionTemplateDataStore
|
||||||
@ -55,26 +82,6 @@ final class ProcessService implements ProcessServiceInterface
|
|||||||
$this->validGetParameterService = $validGetParameterService;
|
$this->validGetParameterService = $validGetParameterService;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return mixed|null
|
|
||||||
*
|
|
||||||
* @throws AccessDeniedException
|
|
||||||
*/
|
|
||||||
private function getResult()
|
|
||||||
{
|
|
||||||
if ($this->requestedActionService->hasRequestedEntity() && $this->requestedActionService->getRequestedEntity()->hasIdentity()) {
|
|
||||||
// READ UPDATE DELETE EXECUTE
|
|
||||||
if ($this->secureRequestedRightCheckerService->check($this->requestedActionService)) {
|
|
||||||
return $this->actionHandlerService->handle();
|
|
||||||
}
|
|
||||||
throw new AccessDeniedException("The user doesn't have the permission to access this page!");
|
|
||||||
}
|
|
||||||
// CREATE
|
|
||||||
$this->requestedActionService->getRequestedEntity()->setClass(TextSource::class);
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @todo Move
|
* @todo Move
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user