Loading module/Application/config/aaa_module.config.php +1 −0 Original line number Diff line number Diff line Loading @@ -44,6 +44,7 @@ $config = [ \Doctrine\DBAL\Event\Listeners\OracleSessionInit::class, ORM\Event\Listeners\HistoriqueListener::class, ORM\Event\Listeners\ParametreEntityListener::class, ORM\Event\Listeners\EntityManagerListener::class, ], ], ], Loading module/Application/src/Entity/Db/ElementPedagogique.php +2 −18 Original line number Diff line number Diff line Loading @@ -9,10 +9,9 @@ use Application\Entity\Db\Traits\PeriodeAwareTrait; use Application\Entity\Db\Traits\SourceAwareTrait; use Application\Entity\Db\Traits\StructureAwareTrait; use Doctrine\Persistence\Mapping\ClassMetadata; use Doctrine\Persistence\ObjectManager; use Doctrine\Persistence\ObjectManagerAware; use UnicaenApp\Entity\HistoriqueAwareInterface; use UnicaenApp\Entity\HistoriqueAwareTrait; use UnicaenApp\Service\EntityManagerAwareInterface; use UnicaenApp\Service\EntityManagerAwareTrait; use UnicaenImport\Entity\Db\Interfaces\ImportAwareInterface; use UnicaenImport\Entity\Db\Traits\ImportAwareTrait; Loading @@ -22,7 +21,7 @@ use Laminas\Permissions\Acl\Resource\ResourceInterface; /** * ElementPedagogique */ class ElementPedagogique implements HistoriqueAwareInterface, ResourceInterface, ImportAwareInterface, ObjectManagerAware class ElementPedagogique implements HistoriqueAwareInterface, ResourceInterface, ImportAwareInterface, EntityManagerAwareInterface { use HistoriqueAwareTrait; use DisciplineAwareTrait; Loading Loading @@ -808,21 +807,6 @@ class ElementPedagogique implements HistoriqueAwareInterface, ResourceInterface, /** * Injects responsible ObjectManager and the ClassMetadata into this persistent object. * * @param ObjectManager $objectManager * @param ClassMetadata $classMetadata * * @return void */ public function injectObjectManager(ObjectManager $objectManager, ClassMetadata $classMetadata) { $this->setEntityManager($objectManager); } function __sleep() { return []; Loading module/Application/src/Entity/Db/Intervenant.php +2 −18 Original line number Diff line number Diff line Loading @@ -11,12 +11,11 @@ use Application\Entity\Db\Traits\StructureAwareTrait; use Application\Entity\Traits\AdresseTrait; use Application\Interfaces\AdresseInterface; use Doctrine\Persistence\Mapping\ClassMetadata; use Doctrine\Persistence\ObjectManager; use Doctrine\Persistence\ObjectManagerAware; use Indicateur\Entity\Db\IndicModifDossier; use Intervenant\Entity\Db\Statut; use UnicaenApp\Entity\HistoriqueAwareInterface; use UnicaenApp\Entity\HistoriqueAwareTrait; use UnicaenApp\Service\EntityManagerAwareInterface; use UnicaenApp\Service\EntityManagerAwareTrait; use UnicaenImport\Entity\Db\Interfaces\ImportAwareInterface; use UnicaenImport\Entity\Db\Traits\ImportAwareTrait; Loading @@ -27,7 +26,7 @@ use Laminas\Permissions\Acl\Resource\ResourceInterface; * Intervenant * */ class Intervenant implements HistoriqueAwareInterface, ResourceInterface, ImportAwareInterface, ObjectManagerAware, AdresseInterface class Intervenant implements HistoriqueAwareInterface, ResourceInterface, ImportAwareInterface, EntityManagerAwareInterface, AdresseInterface { use AnneeAwareTrait; use StructureAwareTrait; Loading Loading @@ -364,21 +363,6 @@ class Intervenant implements HistoriqueAwareInterface, ResourceInterface, Import /** * Injects responsible ObjectManager and the ClassMetadata into this persistent object. * * @param ObjectManager $objectManager * @param ClassMetadata $classMetadata * * @return void */ public function injectObjectManager(ObjectManager $objectManager, ClassMetadata $classMetadata) { $this->setEntityManager($objectManager); } /** * @param bool $demande */ Loading module/Application/src/Entity/Db/IntervenantDossier.php +2 −18 Original line number Diff line number Diff line Loading @@ -7,11 +7,10 @@ use Application\Entity\Db\Traits\EmployeurAwareTrait; use Application\Entity\Traits\AdresseTrait; use Application\Interfaces\AdresseInterface; use Doctrine\Persistence\Mapping\ClassMetadata; use Doctrine\Persistence\ObjectManager; use Doctrine\Persistence\ObjectManagerAware; use Intervenant\Entity\Db\Statut; use UnicaenApp\Entity\HistoriqueAwareInterface; use UnicaenApp\Entity\HistoriqueAwareTrait; use UnicaenApp\Service\EntityManagerAwareInterface; use UnicaenApp\Service\EntityManagerAwareTrait; use Laminas\Permissions\Acl\Resource\ResourceInterface; Loading @@ -19,7 +18,7 @@ use Laminas\Permissions\Acl\Resource\ResourceInterface; * IntervenantDossier * */ class IntervenantDossier implements HistoriqueAwareInterface, ResourceInterface, ObjectManagerAware, AdresseInterface class IntervenantDossier implements HistoriqueAwareInterface, ResourceInterface, EntityManagerAwareInterface, AdresseInterface { use CiviliteAwareTrait; use AdresseTrait; Loading Loading @@ -217,21 +216,6 @@ class IntervenantDossier implements HistoriqueAwareInterface, ResourceInterface, /** * Injects responsible ObjectManager and the ClassMetadata into this persistent object. * * @param ObjectManager $objectManager * @param ClassMetadata $classMetadata * * @return void */ public function injectObjectManager(ObjectManager $objectManager, ClassMetadata $classMetadata) { $this->setEntityManager($objectManager); } /** * Get statut * Loading module/Application/src/ORM/Event/Listeners/EntityManagerListener.php 0 → 100644 +45 −0 Original line number Diff line number Diff line <?php namespace Application\ORM\Event\Listeners; use Application\Interfaces\ParametreEntityInterface; use Application\Service\Traits\ContextServiceAwareTrait; use Application\Service\Traits\UtilisateurServiceAwareTrait; use Doctrine\Common\EventSubscriber; use Doctrine\ORM\Event\LifecycleEventArgs; use Doctrine\ORM\Event\PreUpdateEventArgs; use Doctrine\ORM\Events; use Doctrine\ORM\Mapping\PostLoad; use UnicaenApp\Entity\HistoriqueAwareInterface; use UnicaenApp\Service\EntityManagerAwareInterface; /** * Description of HistoriqueListener * * @author Laurent Lécluse <laurent.lecluse at unicaen.fr> */ class EntityManagerListener implements EventSubscriber { public function postload(LifecycleEventArgs $args) { $entity = $args->getEntity(); if ($entity instanceof EntityManagerAwareInterface) { if (!$entity->getEntityManager()) { $entity->setEntityManager($args->getEntityManager()); } } } /** * {@inheritdoc} */ public function getSubscribedEvents() { return [Events::postLoad]; } } No newline at end of file Loading
module/Application/config/aaa_module.config.php +1 −0 Original line number Diff line number Diff line Loading @@ -44,6 +44,7 @@ $config = [ \Doctrine\DBAL\Event\Listeners\OracleSessionInit::class, ORM\Event\Listeners\HistoriqueListener::class, ORM\Event\Listeners\ParametreEntityListener::class, ORM\Event\Listeners\EntityManagerListener::class, ], ], ], Loading
module/Application/src/Entity/Db/ElementPedagogique.php +2 −18 Original line number Diff line number Diff line Loading @@ -9,10 +9,9 @@ use Application\Entity\Db\Traits\PeriodeAwareTrait; use Application\Entity\Db\Traits\SourceAwareTrait; use Application\Entity\Db\Traits\StructureAwareTrait; use Doctrine\Persistence\Mapping\ClassMetadata; use Doctrine\Persistence\ObjectManager; use Doctrine\Persistence\ObjectManagerAware; use UnicaenApp\Entity\HistoriqueAwareInterface; use UnicaenApp\Entity\HistoriqueAwareTrait; use UnicaenApp\Service\EntityManagerAwareInterface; use UnicaenApp\Service\EntityManagerAwareTrait; use UnicaenImport\Entity\Db\Interfaces\ImportAwareInterface; use UnicaenImport\Entity\Db\Traits\ImportAwareTrait; Loading @@ -22,7 +21,7 @@ use Laminas\Permissions\Acl\Resource\ResourceInterface; /** * ElementPedagogique */ class ElementPedagogique implements HistoriqueAwareInterface, ResourceInterface, ImportAwareInterface, ObjectManagerAware class ElementPedagogique implements HistoriqueAwareInterface, ResourceInterface, ImportAwareInterface, EntityManagerAwareInterface { use HistoriqueAwareTrait; use DisciplineAwareTrait; Loading Loading @@ -808,21 +807,6 @@ class ElementPedagogique implements HistoriqueAwareInterface, ResourceInterface, /** * Injects responsible ObjectManager and the ClassMetadata into this persistent object. * * @param ObjectManager $objectManager * @param ClassMetadata $classMetadata * * @return void */ public function injectObjectManager(ObjectManager $objectManager, ClassMetadata $classMetadata) { $this->setEntityManager($objectManager); } function __sleep() { return []; Loading
module/Application/src/Entity/Db/Intervenant.php +2 −18 Original line number Diff line number Diff line Loading @@ -11,12 +11,11 @@ use Application\Entity\Db\Traits\StructureAwareTrait; use Application\Entity\Traits\AdresseTrait; use Application\Interfaces\AdresseInterface; use Doctrine\Persistence\Mapping\ClassMetadata; use Doctrine\Persistence\ObjectManager; use Doctrine\Persistence\ObjectManagerAware; use Indicateur\Entity\Db\IndicModifDossier; use Intervenant\Entity\Db\Statut; use UnicaenApp\Entity\HistoriqueAwareInterface; use UnicaenApp\Entity\HistoriqueAwareTrait; use UnicaenApp\Service\EntityManagerAwareInterface; use UnicaenApp\Service\EntityManagerAwareTrait; use UnicaenImport\Entity\Db\Interfaces\ImportAwareInterface; use UnicaenImport\Entity\Db\Traits\ImportAwareTrait; Loading @@ -27,7 +26,7 @@ use Laminas\Permissions\Acl\Resource\ResourceInterface; * Intervenant * */ class Intervenant implements HistoriqueAwareInterface, ResourceInterface, ImportAwareInterface, ObjectManagerAware, AdresseInterface class Intervenant implements HistoriqueAwareInterface, ResourceInterface, ImportAwareInterface, EntityManagerAwareInterface, AdresseInterface { use AnneeAwareTrait; use StructureAwareTrait; Loading Loading @@ -364,21 +363,6 @@ class Intervenant implements HistoriqueAwareInterface, ResourceInterface, Import /** * Injects responsible ObjectManager and the ClassMetadata into this persistent object. * * @param ObjectManager $objectManager * @param ClassMetadata $classMetadata * * @return void */ public function injectObjectManager(ObjectManager $objectManager, ClassMetadata $classMetadata) { $this->setEntityManager($objectManager); } /** * @param bool $demande */ Loading
module/Application/src/Entity/Db/IntervenantDossier.php +2 −18 Original line number Diff line number Diff line Loading @@ -7,11 +7,10 @@ use Application\Entity\Db\Traits\EmployeurAwareTrait; use Application\Entity\Traits\AdresseTrait; use Application\Interfaces\AdresseInterface; use Doctrine\Persistence\Mapping\ClassMetadata; use Doctrine\Persistence\ObjectManager; use Doctrine\Persistence\ObjectManagerAware; use Intervenant\Entity\Db\Statut; use UnicaenApp\Entity\HistoriqueAwareInterface; use UnicaenApp\Entity\HistoriqueAwareTrait; use UnicaenApp\Service\EntityManagerAwareInterface; use UnicaenApp\Service\EntityManagerAwareTrait; use Laminas\Permissions\Acl\Resource\ResourceInterface; Loading @@ -19,7 +18,7 @@ use Laminas\Permissions\Acl\Resource\ResourceInterface; * IntervenantDossier * */ class IntervenantDossier implements HistoriqueAwareInterface, ResourceInterface, ObjectManagerAware, AdresseInterface class IntervenantDossier implements HistoriqueAwareInterface, ResourceInterface, EntityManagerAwareInterface, AdresseInterface { use CiviliteAwareTrait; use AdresseTrait; Loading Loading @@ -217,21 +216,6 @@ class IntervenantDossier implements HistoriqueAwareInterface, ResourceInterface, /** * Injects responsible ObjectManager and the ClassMetadata into this persistent object. * * @param ObjectManager $objectManager * @param ClassMetadata $classMetadata * * @return void */ public function injectObjectManager(ObjectManager $objectManager, ClassMetadata $classMetadata) { $this->setEntityManager($objectManager); } /** * Get statut * Loading
module/Application/src/ORM/Event/Listeners/EntityManagerListener.php 0 → 100644 +45 −0 Original line number Diff line number Diff line <?php namespace Application\ORM\Event\Listeners; use Application\Interfaces\ParametreEntityInterface; use Application\Service\Traits\ContextServiceAwareTrait; use Application\Service\Traits\UtilisateurServiceAwareTrait; use Doctrine\Common\EventSubscriber; use Doctrine\ORM\Event\LifecycleEventArgs; use Doctrine\ORM\Event\PreUpdateEventArgs; use Doctrine\ORM\Events; use Doctrine\ORM\Mapping\PostLoad; use UnicaenApp\Entity\HistoriqueAwareInterface; use UnicaenApp\Service\EntityManagerAwareInterface; /** * Description of HistoriqueListener * * @author Laurent Lécluse <laurent.lecluse at unicaen.fr> */ class EntityManagerListener implements EventSubscriber { public function postload(LifecycleEventArgs $args) { $entity = $args->getEntity(); if ($entity instanceof EntityManagerAwareInterface) { if (!$entity->getEntityManager()) { $entity->setEntityManager($args->getEntityManager()); } } } /** * {@inheritdoc} */ public function getSubscribedEvents() { return [Events::postLoad]; } } No newline at end of file