2019-01-06 11:32:05 +01:00
|
|
|
<?php
|
|
|
|
|
2019-02-17 14:33:19 +01:00
|
|
|
namespace Infinito\Domain\FormManagement;
|
2019-01-06 11:32:05 +01:00
|
|
|
|
2019-02-17 14:33:19 +01:00
|
|
|
use Infinito\Domain\TemplateManagement\TemplatePathInformationInterface;
|
|
|
|
use Infinito\Domain\EntityManagement\EntityMetaInformationInterface;
|
2019-01-06 11:32:05 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @author kevinfrantz
|
2019-01-26 19:47:50 +01:00
|
|
|
*
|
|
|
|
* @deprecated
|
2019-01-06 11:32:05 +01:00
|
|
|
*/
|
|
|
|
final class FormMetaInformation implements FormMetaInformationInterface
|
|
|
|
{
|
|
|
|
const FOLDER = 'form';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @var EntityMetaInformationInterface
|
|
|
|
*/
|
|
|
|
private $entityMetaInformation;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
private $formClass;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param EntityMetaInformationInterface $entityMetaInformation
|
|
|
|
*/
|
|
|
|
public function __construct(EntityMetaInformationInterface $entityMetaInformation)
|
|
|
|
{
|
|
|
|
$this->entityMetaInformation = $entityMetaInformation;
|
|
|
|
$this->setFormClass();
|
|
|
|
}
|
|
|
|
|
|
|
|
private function setFormClass(): void
|
|
|
|
{
|
2019-02-17 14:33:19 +01:00
|
|
|
$this->formClass = 'Infinito\\Form';
|
2019-01-06 15:15:47 +01:00
|
|
|
foreach ($this->entityMetaInformation->getNamespacePathMap()->getFolders() as $element) {
|
2019-01-06 11:32:05 +01:00
|
|
|
$this->formClass .= '\\'.ucfirst($element);
|
|
|
|
}
|
|
|
|
$this->formClass .= '\\'.ucfirst($this->entityMetaInformation->getPureName()).'Type';
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* {@inheritdoc}
|
|
|
|
*
|
2019-02-17 14:33:19 +01:00
|
|
|
* @see \Infinito\Domain\FormManagement\FormMetaInformationInterface::getFormClass()
|
2019-01-06 11:32:05 +01:00
|
|
|
*/
|
|
|
|
public function getFormClass(): string
|
|
|
|
{
|
|
|
|
return $this->formClass;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* {@inheritdoc}
|
|
|
|
*
|
2019-02-17 14:33:19 +01:00
|
|
|
* @see \Infinito\Domain\FormManagement\FormMetaInformationInterface::getTemplatePathInformation()
|
2019-01-06 11:32:05 +01:00
|
|
|
*/
|
|
|
|
public function getTemplatePathInformation(): TemplatePathInformationInterface
|
|
|
|
{
|
2019-01-06 16:26:46 +01:00
|
|
|
return $this->entityMetaInformation->getTemplatePathFormAndView()->getForm();
|
2019-01-06 11:32:05 +01:00
|
|
|
}
|
|
|
|
}
|