mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2025-09-13 21:57:16 +02:00
Optimized RequestedEntityFormBuilderService and implemented form classes and logic
This commit is contained in:
@@ -2,16 +2,55 @@
|
||||
|
||||
namespace App\Domain\ActionManagement\Create;
|
||||
|
||||
use App\Domain\SourceManagement\SourceClassInformationService;
|
||||
use App\Form\Source\SourceType;
|
||||
use App\Entity\Source\AbstractSource;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
*/
|
||||
final class CreateSourceAction extends AbstractCreateAction
|
||||
{
|
||||
protected function isValidByForm(): bool
|
||||
/**
|
||||
* @var string default class name, when no parameter is defined
|
||||
*/
|
||||
const DEFAULT_CLASS = AbstractSource::class;
|
||||
|
||||
/**
|
||||
* @see SourceClassInformationService
|
||||
*
|
||||
* @var string The source class which should be used
|
||||
*/
|
||||
private $sourceClass;
|
||||
|
||||
private function setSourceClass(): void
|
||||
{
|
||||
$request = $this->actionService->getRequest();
|
||||
$this->sourceClass = $request->get(SourceType::CLASS_PARAMETER_NAME, self::DEFAULT_CLASS);
|
||||
}
|
||||
|
||||
private function prepare(): void
|
||||
{
|
||||
$this->setSourceClass();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @see \App\Domain\ActionManagement\AbstractAction::isValidByForm()
|
||||
*/
|
||||
protected function isValidByForm(): bool
|
||||
{
|
||||
$this->actionService->getForm();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @see \App\Domain\ActionManagement\AbstractAction::proccess()
|
||||
*/
|
||||
protected function proccess()
|
||||
{
|
||||
$this->prepare();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user