Loading src/UnicaenAutoform/Service/Categorie/CategorieService.php +32 −0 Original line number Diff line number Diff line Loading @@ -2,6 +2,7 @@ namespace UnicaenAutoform\Service\Categorie; use DateTime; use Doctrine\ORM\NonUniqueResultException; use Doctrine\ORM\QueryBuilder; use DoctrineModule\Persistence\ProvidesObjectManager; Loading @@ -22,12 +23,24 @@ class CategorieService { $this->getObjectManager()->persist($categorie); $this->getObjectManager()->flush($categorie); $formulaire = $categorie->getFormulaire(); if ($formulaire) { $formulaire->setHistoModification(new DateTime()); $this->getObjectManager()->flush($formulaire); } return $categorie; } public function update(Categorie $categorie): Categorie { $this->getObjectManager()->flush($categorie); $formulaire = $categorie->getFormulaire(); if ($formulaire) { $formulaire->setHistoModification(new DateTime()); $this->getObjectManager()->flush($formulaire); } return $categorie; } Loading @@ -35,6 +48,12 @@ class CategorieService { $categorie->historiser(); $this->getObjectManager()->flush($categorie); $formulaire = $categorie->getFormulaire(); if ($formulaire) { $formulaire->setHistoModification(new DateTime()); $this->getObjectManager()->flush($formulaire); } return $categorie; } Loading @@ -42,6 +61,13 @@ class CategorieService { $categorie->dehistoriser(); $this->getObjectManager()->flush($categorie); $formulaire = $categorie->getFormulaire(); if ($formulaire) { $formulaire->setHistoModification(new DateTime()); $this->getObjectManager()->flush($formulaire); } return $categorie; } Loading @@ -49,6 +75,12 @@ class CategorieService { $this->getObjectManager()->remove($categorie); $this->getObjectManager()->flush(); $formulaire = $categorie->getFormulaire(); if ($formulaire) { $formulaire->setHistoModification(new DateTime()); $this->getObjectManager()->flush($formulaire); } return $categorie; } Loading src/UnicaenAutoform/Service/Champ/ChampService.php +32 −0 Original line number Diff line number Diff line Loading @@ -2,6 +2,7 @@ namespace UnicaenAutoform\Service\Champ; use DateTime; use Doctrine\ORM\NonUniqueResultException; use Doctrine\ORM\QueryBuilder; use DoctrineModule\Persistence\ProvidesObjectManager; Loading @@ -20,12 +21,24 @@ class ChampService { $this->getObjectManager()->persist($champ); $this->getObjectManager()->flush($champ); $formulaire = $champ->getCategorie()?->getFormulaire(); if ($formulaire) { $formulaire->setHistoModification(new DateTime()); $this->getObjectManager()->flush($formulaire); } return $champ; } public function update(Champ $champ): Champ { $this->getObjectManager()->flush($champ); $formulaire = $champ->getCategorie()?->getFormulaire(); if ($formulaire) { $formulaire->setHistoModification(new DateTime()); $this->getObjectManager()->flush($formulaire); } return $champ; } Loading @@ -33,6 +46,12 @@ class ChampService { $champ->historiser(); $this->getObjectManager()->flush($champ); $formulaire = $champ->getCategorie()?->getFormulaire(); if ($formulaire) { $formulaire->setHistoModification(new DateTime()); $this->getObjectManager()->flush($formulaire); } return $champ; } Loading @@ -40,6 +59,12 @@ class ChampService { $champ->dehistoriser(); $this->getObjectManager()->flush($champ); $formulaire = $champ->getCategorie()?->getFormulaire(); if ($formulaire) { $formulaire->setHistoModification(new DateTime()); $this->getObjectManager()->flush($formulaire); } return $champ; } Loading @@ -51,6 +76,13 @@ class ChampService { $this->getObjectManager()->remove($champ); $this->getObjectManager()->flush(); $formulaire = $champ->getCategorie()?->getFormulaire(); if ($formulaire) { $formulaire->setHistoModification(new DateTime()); $this->getObjectManager()->flush($formulaire); } return $champ; } Loading Loading
src/UnicaenAutoform/Service/Categorie/CategorieService.php +32 −0 Original line number Diff line number Diff line Loading @@ -2,6 +2,7 @@ namespace UnicaenAutoform\Service\Categorie; use DateTime; use Doctrine\ORM\NonUniqueResultException; use Doctrine\ORM\QueryBuilder; use DoctrineModule\Persistence\ProvidesObjectManager; Loading @@ -22,12 +23,24 @@ class CategorieService { $this->getObjectManager()->persist($categorie); $this->getObjectManager()->flush($categorie); $formulaire = $categorie->getFormulaire(); if ($formulaire) { $formulaire->setHistoModification(new DateTime()); $this->getObjectManager()->flush($formulaire); } return $categorie; } public function update(Categorie $categorie): Categorie { $this->getObjectManager()->flush($categorie); $formulaire = $categorie->getFormulaire(); if ($formulaire) { $formulaire->setHistoModification(new DateTime()); $this->getObjectManager()->flush($formulaire); } return $categorie; } Loading @@ -35,6 +48,12 @@ class CategorieService { $categorie->historiser(); $this->getObjectManager()->flush($categorie); $formulaire = $categorie->getFormulaire(); if ($formulaire) { $formulaire->setHistoModification(new DateTime()); $this->getObjectManager()->flush($formulaire); } return $categorie; } Loading @@ -42,6 +61,13 @@ class CategorieService { $categorie->dehistoriser(); $this->getObjectManager()->flush($categorie); $formulaire = $categorie->getFormulaire(); if ($formulaire) { $formulaire->setHistoModification(new DateTime()); $this->getObjectManager()->flush($formulaire); } return $categorie; } Loading @@ -49,6 +75,12 @@ class CategorieService { $this->getObjectManager()->remove($categorie); $this->getObjectManager()->flush(); $formulaire = $categorie->getFormulaire(); if ($formulaire) { $formulaire->setHistoModification(new DateTime()); $this->getObjectManager()->flush($formulaire); } return $categorie; } Loading
src/UnicaenAutoform/Service/Champ/ChampService.php +32 −0 Original line number Diff line number Diff line Loading @@ -2,6 +2,7 @@ namespace UnicaenAutoform\Service\Champ; use DateTime; use Doctrine\ORM\NonUniqueResultException; use Doctrine\ORM\QueryBuilder; use DoctrineModule\Persistence\ProvidesObjectManager; Loading @@ -20,12 +21,24 @@ class ChampService { $this->getObjectManager()->persist($champ); $this->getObjectManager()->flush($champ); $formulaire = $champ->getCategorie()?->getFormulaire(); if ($formulaire) { $formulaire->setHistoModification(new DateTime()); $this->getObjectManager()->flush($formulaire); } return $champ; } public function update(Champ $champ): Champ { $this->getObjectManager()->flush($champ); $formulaire = $champ->getCategorie()?->getFormulaire(); if ($formulaire) { $formulaire->setHistoModification(new DateTime()); $this->getObjectManager()->flush($formulaire); } return $champ; } Loading @@ -33,6 +46,12 @@ class ChampService { $champ->historiser(); $this->getObjectManager()->flush($champ); $formulaire = $champ->getCategorie()?->getFormulaire(); if ($formulaire) { $formulaire->setHistoModification(new DateTime()); $this->getObjectManager()->flush($formulaire); } return $champ; } Loading @@ -40,6 +59,12 @@ class ChampService { $champ->dehistoriser(); $this->getObjectManager()->flush($champ); $formulaire = $champ->getCategorie()?->getFormulaire(); if ($formulaire) { $formulaire->setHistoModification(new DateTime()); $this->getObjectManager()->flush($formulaire); } return $champ; } Loading @@ -51,6 +76,13 @@ class ChampService { $this->getObjectManager()->remove($champ); $this->getObjectManager()->flush(); $formulaire = $champ->getCategorie()?->getFormulaire(); if ($formulaire) { $formulaire->setHistoModification(new DateTime()); $this->getObjectManager()->flush($formulaire); } return $champ; } Loading