@@ -0,0 +1,10 @@ | |||
<?php | |||
namespace Lc\PietroBundle\Controller; | |||
use Lc\SovBundle\Controller\AbstractAdminController as SovAbstractAdminController; | |||
abstract class AbstractAdminController extends SovAbstractAdminController | |||
{ | |||
use ControllerTrait; | |||
} |
@@ -0,0 +1,10 @@ | |||
<?php | |||
namespace Lc\PietroBundle\Controller; | |||
use Lc\SovBundle\Controller\AbstractController as SovAbstractController; | |||
abstract class AbstractController extends SovAbstractController | |||
{ | |||
use ControllerTrait; | |||
} |
@@ -0,0 +1,72 @@ | |||
<?php | |||
namespace Lc\PietroBundle\Controller; | |||
use Lc\PietroBundle\Container\Dream\DreamContainer; | |||
use Lc\PietroBundle\Container\IndividualData\IndividualDataContainer; | |||
use Lc\PietroBundle\Container\ProjectBoost\ProjectBoostContainer; | |||
use Lc\PietroBundle\Container\ProjectInspiring\ProjectInspiringContainer; | |||
use Lc\PietroBundle\Container\Revolt\RevoltContainer; | |||
use Lc\PietroBundle\Container\Subthematic\SubthematicContainer; | |||
use Lc\PietroBundle\Container\Territory\TerritoryContainer; | |||
use Lc\PietroBundle\Container\Thematic\ThematicContainer; | |||
trait ControllerTrait | |||
{ | |||
public static function getSubscribedServices() | |||
{ | |||
return array_merge( | |||
parent::getSubscribedServices(), | |||
[ | |||
DreamContainer::class => DreamContainer::class, | |||
IndividualDataContainer::class => IndividualDataContainer::class, | |||
ProjectBoostContainer::class => ProjectBoostContainer::class, | |||
ProjectInspiringContainer::class => ProjectInspiringContainer::class, | |||
RevoltContainer::class => RevoltContainer::class, | |||
SubthematicContainer::class => SubthematicContainer::class, | |||
TerritoryContainer::class => TerritoryContainer::class, | |||
ThematicContainer::class => ThematicContainer::class, | |||
] | |||
); | |||
} | |||
public function getDreamContainer(): DreamContainer | |||
{ | |||
return $this->get(DreamContainer::class); | |||
} | |||
public function getIndividualDataContainer(): IndividualDataContainer | |||
{ | |||
return $this->get(IndividualDataContainer::class); | |||
} | |||
public function getProjectBoostContainer(): ProjectBoostContainer | |||
{ | |||
return $this->get(ProjectBoostContainer::class); | |||
} | |||
public function getProjectInspiringContainer(): ProjectInspiringContainer | |||
{ | |||
return $this->get(ProjectInspiringContainer::class); | |||
} | |||
public function getRevoltContainer(): RevoltContainer | |||
{ | |||
return $this->get(RevoltContainer::class); | |||
} | |||
public function getSubthematicContainer(): SubthematicContainer | |||
{ | |||
return $this->get(SubthematicContainer::class); | |||
} | |||
public function getTerritoryContainer(): TerritoryContainer | |||
{ | |||
return $this->get(TerritoryContainer::class); | |||
} | |||
public function getThematicContainer(): ThematicContainer | |||
{ | |||
return $this->get(ThematicContainer::class); | |||
} | |||
} |
@@ -25,8 +25,8 @@ use Lc\PietroBundle\Repository\Dream\DreamStore; | |||
use Lc\PietroBundle\Repository\ProjectBoost\ProjectBoostStore; | |||
use Lc\PietroBundle\Repository\ProjectInspiring\ProjectInspiringStore; | |||
use Lc\PietroBundle\Repository\Revolt\RevoltStore; | |||
use Lc\PietroBundle\Controller\AbstractAdminController; | |||
use Symfony\Component\HttpFoundation\Request; | |||
use Lc\SovBundle\Controller\AbstractAdminController; | |||
use EasyCorp\Bundle\EasyAdminBundle\Field\EmailField; | |||
use EasyCorp\Bundle\EasyAdminBundle\Field\TextField; | |||
use Lc\SovBundle\Field\CollectionField; | |||
@@ -54,14 +54,7 @@ abstract class IndividualDataAdminController extends AbstractAdminController | |||
public function createEntity(string $entityFqcn) | |||
{ | |||
return $this->get(IndividualDataContainer::class) | |||
->getFactory() | |||
->create(); | |||
} | |||
public static function getEntityFqcn(): string | |||
{ | |||
return IndividualData::class; | |||
return $this->getIndividualDataContainer()->getFactory()->create(); | |||
} | |||
public function configureFields(string $pageName): iterable |
@@ -2,16 +2,16 @@ | |||
namespace Lc\PietroBundle\Controller\Subthematic; | |||
use Lc\PietroBundle\Model\Subthematic; | |||
use Lc\PietroBundle\Container\Subthematic\SubthematicContainer; | |||
use EasyCorp\Bundle\EasyAdminBundle\Field\AssociationField; | |||
use EasyCorp\Bundle\EasyAdminBundle\Field\TextField; | |||
use Lc\SovBundle\Controller\AbstractAdminController; | |||
use Lc\PietroBundle\Controller\AbstractAdminController; | |||
class SubthematicAdminController extends AbstractAdminController | |||
abstract class SubthematicAdminController extends AbstractAdminController | |||
{ | |||
public static function getEntityFqcn(): string | |||
public function createEntity(string $entityFqcn) | |||
{ | |||
return Subthematic::class; | |||
return $this->getSubthematicContainer()->getFactory()->create(); | |||
} | |||
public function configureFields(string $pageName): iterable |
@@ -2,15 +2,15 @@ | |||
namespace Lc\PietroBundle\Controller\Territory; | |||
use Lc\PietroBundle\Model\Territory; | |||
use Lc\PietroBundle\Container\Territory\TerritoryContainer; | |||
use EasyCorp\Bundle\EasyAdminBundle\Field\TextField; | |||
use Lc\SovBundle\Controller\AbstractAdminController; | |||
use Lc\PietroBundle\Controller\AbstractAdminController; | |||
abstract class TerritoryAdminController extends AbstractAdminController | |||
{ | |||
public static function getEntityFqcn(): string | |||
public function createEntity(string $entityFqcn) | |||
{ | |||
return Territory::class; | |||
return $this->getTerritoryContainer()->getFactory()->create(); | |||
} | |||
public function configureFields(string $pageName): iterable |
@@ -2,15 +2,14 @@ | |||
namespace Lc\PietroBundle\Controller\Thematic; | |||
use Lc\PietroBundle\Model\Thematic; | |||
use EasyCorp\Bundle\EasyAdminBundle\Field\TextField; | |||
use Lc\SovBundle\Controller\AbstractAdminController as AbstractCrudController; | |||
use Lc\PietroBundle\Controller\AbstractAdminController; | |||
abstract class ThematicAdminController extends AbstractCrudController | |||
abstract class ThematicAdminController extends AbstractAdminController | |||
{ | |||
public static function getEntityFqcn(): string | |||
public function createEntity(string $entityFqcn) | |||
{ | |||
return Thematic::class; | |||
return $this->getThematicContainer()->getFactory()->create(); | |||
} | |||
public function configureFields(string $pageName): iterable |
@@ -3,7 +3,7 @@ | |||
namespace Lc\PietroBundle\Factory\Dream; | |||
use App\Entity\Dream; | |||
use Lc\PietroBundle\Model\DreamInterface; | |||
use Lc\PietroBundle\Model\Dream\DreamInterface; | |||
class DreamFactory | |||
{ |
@@ -3,7 +3,7 @@ | |||
namespace Lc\PietroBundle\Factory\IndividualData; | |||
use App\Entity\IndividualData; | |||
use Lc\PietroBundle\Model\IndividualDataInterface; | |||
use Lc\PietroBundle\Model\IndividualData\IndividualDataInterface; | |||
class IndividualDataFactory | |||
{ |
@@ -3,7 +3,7 @@ | |||
namespace Lc\PietroBundle\Factory\ProjectBoost; | |||
use App\Entity\ProjectBoost; | |||
use Lc\PietroBundle\Model\ProjectBoostInterface; | |||
use Lc\PietroBundle\Model\ProjectBoost\ProjectBoostInterface; | |||
class ProjectBoostFactory | |||
{ |
@@ -3,7 +3,7 @@ | |||
namespace Lc\PietroBundle\Factory\ProjectInspiring; | |||
use App\Entity\ProjectInspiring; | |||
use Lc\PietroBundle\Model\ProjectInspiringInterface; | |||
use Lc\PietroBundle\Model\ProjectInspiring\ProjectInspiringInterface; | |||
class ProjectInspiringFactory | |||
{ |
@@ -3,7 +3,7 @@ | |||
namespace Lc\PietroBundle\Factory\Revolt; | |||
use App\Entity\Revolt; | |||
use Lc\PietroBundle\Model\RevoltInterface; | |||
use Lc\PietroBundle\Model\Revolt\RevoltInterface; | |||
class RevoltFactory | |||
{ |
@@ -3,7 +3,7 @@ | |||
namespace Lc\PietroBundle\Factory\Subthematic; | |||
use App\Entity\Subthematic; | |||
use Lc\PietroBundle\Model\SubthematicInterface; | |||
use Lc\PietroBundle\Model\Subthematic\SubthematicInterface; | |||
class SubthematicFactory | |||
{ |
@@ -3,7 +3,7 @@ | |||
namespace Lc\PietroBundle\Factory\Territory; | |||
use App\Entity\Territory; | |||
use Lc\PietroBundle\Model\TerritoryInterface; | |||
use Lc\PietroBundle\Model\Territory\TerritoryInterface; | |||
class TerritoryFactory | |||
{ |
@@ -3,7 +3,7 @@ | |||
namespace Lc\PietroBundle\Factory\Thematic; | |||
use App\Entity\Thematic; | |||
use Lc\PietroBundle\Model\ThematicInterface; | |||
use Lc\PietroBundle\Model\Thematic\ThematicInterface; | |||
class ThematicFactory | |||
{ |
@@ -2,9 +2,9 @@ | |||
namespace Lc\PietroBundle\Form\Dream; | |||
use Lc\PietroBundle\Model\Dream; | |||
use Lc\PietroBundle\Model\Subthematic; | |||
use Lc\PietroBundle\Model\Thematic; | |||
use Lc\PietroBundle\Model\Dream\DreamInterface; | |||
use Lc\PietroBundle\Model\Subthematic\SubthematicInterface; | |||
use Lc\PietroBundle\Model\Thematic\ThematicInterface; | |||
use Lc\SovBundle\Doctrine\EntityManager; | |||
use Lc\SovBundle\Translation\TranslatorAdmin; | |||
use Symfony\Bridge\Doctrine\Form\Type\EntityType; | |||
@@ -46,7 +46,7 @@ class DreamType extends AbstractType | |||
EntityType::class, | |||
[ | |||
'label' => 'form.field.dream.thematic', | |||
'class' => Thematic::class, | |||
'class' => $this->em->getEntityName(ThematicInterface::class), | |||
'required' => false, | |||
'choice_attr' => function ($choice, $key, $value) { | |||
return ['data-class' => 'theme' . strtolower($value)]; | |||
@@ -62,7 +62,7 @@ class DreamType extends AbstractType | |||
EntityType::class, | |||
[ | |||
'label' => 'form.field.dream.subthematic', | |||
'class' => Subthematic::class, | |||
'class' => $this->em->getEntityName(SubthematicInterface::class), | |||
'required' => false, | |||
'choice_attr' => function ($choice, $key, $value) { | |||
return ['data-class' => 'theme' . strtolower($choice->getThematic()->getId())]; | |||
@@ -82,7 +82,7 @@ class DreamType extends AbstractType | |||
{ | |||
$resolver->setDefaults( | |||
[ | |||
'data_class' => $this->em->getEntityName(Dream::class), | |||
'data_class' => $this->em->getEntityName(DreamInterface::class), | |||
'context' => 'backend' | |||
] | |||
); |
@@ -2,9 +2,9 @@ | |||
namespace Lc\PietroBundle\Form\ProjectBoost; | |||
use Lc\PietroBundle\Model\ProjectBoost; | |||
use Lc\PietroBundle\Model\Subthematic; | |||
use Lc\PietroBundle\Model\Thematic; | |||
use Lc\PietroBundle\Model\ProjectBoost\ProjectBoostInterface; | |||
use Lc\PietroBundle\Model\Subthematic\SubthematicInterface; | |||
use Lc\PietroBundle\Model\Thematic\ThematicInterface; | |||
use Lc\SovBundle\Doctrine\EntityManager; | |||
use Lc\SovBundle\Translation\TranslatorAdmin; | |||
use Symfony\Bridge\Doctrine\Form\Type\EntityType; | |||
@@ -46,7 +46,7 @@ class ProjectBoostType extends AbstractType | |||
EntityType::class, | |||
[ | |||
'label' => 'form.field.projectBoost.thematic', | |||
'class' => Thematic::class, | |||
'class' => $this->em->getEntityName(ThematicInterface::class), | |||
'required' => false, | |||
'choice_attr' => function ($choice, $key, $value) { | |||
return ['data-class' => 'theme' . strtolower($value)]; | |||
@@ -63,7 +63,7 @@ class ProjectBoostType extends AbstractType | |||
EntityType::class, | |||
[ | |||
'label' => 'form.field.projectBoost.subthematic', | |||
'class' => Subthematic::class, | |||
'class' => $this->em->getEntityName(SubthematicInterface::class), | |||
'required' => false, | |||
'choice_attr' => function ($choice, $key, $value) { | |||
return ['data-class' => 'theme' . strtolower($choice->getThematic()->getId())]; | |||
@@ -83,7 +83,7 @@ class ProjectBoostType extends AbstractType | |||
{ | |||
$resolver->setDefaults( | |||
[ | |||
'data_class' => $this->em->getEntityName(ProjectBoost::class), | |||
'data_class' => $this->em->getEntityName(ProjectBoostInterface::class), | |||
'context' => 'backend' | |||
] | |||
); |
@@ -2,9 +2,9 @@ | |||
namespace Lc\PietroBundle\Form\ProjectInspiring; | |||
use Lc\PietroBundle\Model\ProjectInspiring; | |||
use Lc\PietroBundle\Model\Subthematic; | |||
use Lc\PietroBundle\Model\Thematic; | |||
use Lc\PietroBundle\Model\ProjectInspiring\ProjectInspiringInterface; | |||
use Lc\PietroBundle\Model\Subthematic\SubthematicInterface; | |||
use Lc\PietroBundle\Model\Thematic\ThematicInterface; | |||
use Lc\SovBundle\Doctrine\EntityManager; | |||
use Lc\SovBundle\Translation\TranslatorAdmin; | |||
use Symfony\Bridge\Doctrine\Form\Type\EntityType; | |||
@@ -46,7 +46,7 @@ class ProjectInspiringType extends AbstractType | |||
EntityType::class, | |||
[ | |||
'label' => 'form.field.projectinspiring.thematic', | |||
'class' => Thematic::class, | |||
'class' => $this->em->getEntityName(ThematicInterface::class), | |||
'required' => false, | |||
'choice_attr' => function ($choice, $key, $value) { | |||
return ['data-class' => 'theme' . strtolower($value)]; | |||
@@ -62,7 +62,7 @@ class ProjectInspiringType extends AbstractType | |||
EntityType::class, | |||
[ | |||
'label' => 'form.field.projectinspiring.subthematic', | |||
'class' => Subthematic::class, | |||
'class' => $this->em->getEntityName(SubthematicInterface::class), | |||
'required' => false, | |||
'choice_attr' => function ($choice, $key, $value) { | |||
return ['data-class' => 'theme' . strtolower($choice->getThematic()->getId())]; | |||
@@ -82,7 +82,7 @@ class ProjectInspiringType extends AbstractType | |||
{ | |||
$resolver->setDefaults( | |||
[ | |||
'data_class' => $this->em->getEntityName(ProjectInspiring::class), | |||
'data_class' => $this->em->getEntityName(ProjectInspiringInterface::class), | |||
'context' => 'backend' | |||
] | |||
); |
@@ -2,9 +2,9 @@ | |||
namespace Lc\PietroBundle\Form\Revolt; | |||
use Lc\PietroBundle\Model\Revolt; | |||
use Lc\PietroBundle\Model\Subthematic; | |||
use Lc\PietroBundle\Model\Thematic; | |||
use Lc\PietroBundle\Model\Revolt\RevoltInterface; | |||
use Lc\PietroBundle\Model\Subthematic\SubthematicInterface; | |||
use Lc\PietroBundle\Model\Thematic\ThematicInterface; | |||
use Lc\SovBundle\Doctrine\EntityManager; | |||
use Lc\SovBundle\Translation\TranslatorAdmin; | |||
use Symfony\Bridge\Doctrine\Form\Type\EntityType; | |||
@@ -46,7 +46,7 @@ class RevoltType extends AbstractType | |||
EntityType::class, | |||
[ | |||
'label' => 'form.field.revolt.thematic', | |||
'class' => Thematic::class, | |||
'class' => $this->em->getEntityName(ThematicInterface::class), | |||
'required' => false, | |||
'choice_attr' => function ($choice, $key, $value) { | |||
return ['data-class' => 'theme' . strtolower($value)]; | |||
@@ -62,7 +62,7 @@ class RevoltType extends AbstractType | |||
EntityType::class, | |||
[ | |||
'label' => 'form.field.revolt.subthematic', | |||
'class' => Subthematic::class, | |||
'class' => $this->em->getEntityName(SubthematicInterface::class), | |||
'required' => false, | |||
'choice_attr' => function ($choice, $key, $value) { | |||
return ['data-class' => 'theme' . strtolower($choice->getThematic()->getId())]; | |||
@@ -83,7 +83,7 @@ class RevoltType extends AbstractType | |||
) { | |||
$resolver->setDefaults( | |||
[ | |||
'data_class' => $this->em->getEntityName(Revolt::class), | |||
'data_class' => $this->em->getEntityName(RevoltInterface::class), | |||
'context' => 'backend' | |||
] | |||
); |
@@ -6,11 +6,12 @@ use Doctrine\ORM\Mapping as ORM; | |||
use Lc\PietroBundle\Doctrine\Extension\DescriptionProjectInterface; | |||
use Lc\PietroBundle\Doctrine\Extension\DescriptionProjectTrait; | |||
use Lc\PietroBundle\Model\IndividualData\IndividualDataInterface; | |||
use Lc\SovBundle\Doctrine\EntityInterface; | |||
/** | |||
* @ORM\MappedSuperclass() | |||
*/ | |||
abstract class Dream implements DescriptionProjectInterface, DreamInterface | |||
abstract class Dream implements DescriptionProjectInterface, DreamInterface, EntityInterface | |||
{ | |||
use DescriptionProjectTrait; | |||
@@ -6,11 +6,12 @@ use Doctrine\ORM\Mapping as ORM; | |||
use Lc\PietroBundle\Doctrine\Extension\DescriptionProjectInterface; | |||
use Lc\PietroBundle\Doctrine\Extension\DescriptionProjectTrait; | |||
use Lc\PietroBundle\Model\IndividualData\IndividualData; | |||
use Lc\SovBundle\Doctrine\EntityInterface; | |||
/** | |||
* @ORM\MappedSuperclass() | |||
*/ | |||
abstract class ProjectBoost implements DescriptionProjectInterface, ProjectBoostInterface | |||
abstract class ProjectBoost implements DescriptionProjectInterface, ProjectBoostInterface, EntityInterface | |||
{ | |||
use DescriptionProjectTrait; | |||
@@ -6,11 +6,12 @@ use Doctrine\ORM\Mapping as ORM; | |||
use Lc\PietroBundle\Doctrine\Extension\DescriptionProjectInterface; | |||
use Lc\PietroBundle\Doctrine\Extension\DescriptionProjectTrait; | |||
use Lc\PietroBundle\Model\IndividualData\IndividualDataInterface; | |||
use Lc\SovBundle\Doctrine\EntityInterface; | |||
/** | |||
* @ORM\MappedSuperclass() | |||
*/ | |||
abstract class ProjectInspiring implements DescriptionProjectInterface, ProjectInspiringInterface | |||
abstract class ProjectInspiring implements DescriptionProjectInterface, ProjectInspiringInterface, EntityInterface | |||
{ | |||
use DescriptionProjectTrait; | |||
@@ -6,11 +6,12 @@ use Doctrine\ORM\Mapping as ORM; | |||
use Lc\PietroBundle\Doctrine\Extension\DescriptionProjectInterface; | |||
use Lc\PietroBundle\Doctrine\Extension\DescriptionProjectTrait; | |||
use Lc\PietroBundle\Model\IndividualData\IndividualDataInterface; | |||
use Lc\SovBundle\Doctrine\EntityInterface; | |||
/** | |||
* @ORM\MappedSuperclass() | |||
*/ | |||
abstract class Revolt implements DescriptionProjectInterface, RevoltInterface | |||
abstract class Revolt implements DescriptionProjectInterface, RevoltInterface, EntityInterface | |||
{ | |||
use DescriptionProjectTrait; | |||
@@ -4,11 +4,12 @@ namespace Lc\PietroBundle\Model\Subthematic; | |||
use Doctrine\ORM\Mapping as ORM; | |||
use Lc\PietroBundle\Model\Thematic\ThematicInterface; | |||
use Lc\SovBundle\Doctrine\EntityInterface; | |||
/** | |||
* @ORM\MappedSuperclass() | |||
*/ | |||
abstract class Subthematic implements SubthematicInterface | |||
abstract class Subthematic implements SubthematicInterface, EntityInterface | |||
{ | |||
/** | |||
* @ORM\Column(type="string", length=255) |
@@ -6,13 +6,14 @@ use Doctrine\Common\Collections\ArrayCollection; | |||
use Doctrine\Common\Collections\Collection; | |||
use Doctrine\ORM\Mapping as ORM; | |||
use Lc\PietroBundle\Model\IndividualData\IndividualDataInterface; | |||
use Lc\SovBundle\Doctrine\EntityInterface; | |||
use Lc\SovBundle\Doctrine\Extension\DevAliasInterface; | |||
use Lc\SovBundle\Doctrine\Extension\DevAliasTrait; | |||
/** | |||
* @ORM\MappedSuperclass() | |||
*/ | |||
abstract class Territory implements TerritoryInterface, DevAliasInterface | |||
abstract class Territory implements TerritoryInterface, DevAliasInterface, EntityInterface | |||
{ | |||
use DevAliasTrait; | |||
@@ -6,11 +6,12 @@ use Doctrine\Common\Collections\ArrayCollection; | |||
use Doctrine\Common\Collections\Collection; | |||
use Doctrine\ORM\Mapping as ORM; | |||
use Lc\PietroBundle\Model\Subthematic\SubthematicInterface; | |||
use Lc\SovBundle\Doctrine\EntityInterface; | |||
/** | |||
* @ORM\MappedSuperclass() | |||
*/ | |||
abstract class Thematic implements ThematicInterface | |||
abstract class Thematic implements ThematicInterface, EntityInterface | |||
{ | |||
/** |
@@ -10,7 +10,7 @@ use Lc\SovBundle\Repository\StoreInterface; | |||
class SubthematicStore extends AbstractStore implements StoreInterface | |||
{ | |||
public function __construct(IndividualDataRepositoryQuery $query) | |||
public function __construct(SubthematicRepositoryQuery $query) | |||
{ | |||
$this->query = $query; | |||
} |