Loading module/Application/src/Application/Service/Categorie/CategorieService.php +2 −4 Original line number Diff line number Diff line Loading @@ -11,8 +11,6 @@ use Zend\Mvc\Controller\AbstractActionController; class CategorieService { // use UserServiceAwareTrait; // use EntityManagerAwareTrait; use GestionEntiteHistorisationTrait; /** GESTION DES ENTITES *******************************************************************************************/ Loading Loading @@ -129,7 +127,7 @@ class CategorieService * @param string $param * @return Categorie */ public function getRequestedCategorie($controller, $param='categorie') public function getRequestedCategorie(AbstractActionController $controller, $param='categorie') { $id = $controller->params()->fromRoute($param); $result = $this->getCategorie($id); Loading @@ -140,7 +138,7 @@ class CategorieService * @param string $code * @return Categorie */ public function getCategorieByCode($code) public function getCategorieByCode(string $code) { $qb = $this->createQueryBuider() ->andWhere('categorie.code = :code') Loading module/Application/src/Application/Service/Categorie/CategorieServiceAwareTrait.php +2 −2 Original line number Diff line number Diff line Loading @@ -10,7 +10,7 @@ trait CategorieServiceAwareTrait { /** * @return CategorieService */ public function getCategorieService() public function getCategorieService() : CategorieService { return $this->categorieService; } Loading @@ -19,7 +19,7 @@ trait CategorieServiceAwareTrait { * @param CategorieService $categorieService * @return CategorieService */ public function setCategorieService($categorieService) public function setCategorieService(CategorieService $categorieService) : CategorieService { $this->categorieService = $categorieService; return $this->categorieService; Loading module/Application/src/Application/Service/Corps/CorpsService.php +2 −17 Original line number Diff line number Diff line Loading @@ -35,7 +35,8 @@ class CorpsService { * @return QueryBuilder */ public function createQueryBuilder() { $qb = $this->getEntityManager()->getRepository(Corps::class)->createQueryBuilder('corps'); $qb = $this->getEntityManager()->getRepository(Corps::class)->createQueryBuilder('corps') ; return $qb; } Loading @@ -58,21 +59,6 @@ class CorpsService { ; } $result = $qb->getQuery()->getResult(); return $result; } /** * @param string $champ * @param string $ordre * @return Corps[] */ public function getCorpsHistorises($champ = 'libelleLong', $ordre = 'ASC') { $qb = $this->createQueryBuilder() ->andWhere('corps.histo IS NOT NULL') ->orderBy('corps.' . $champ, $ordre) ; $result = $qb->getQuery()->getResult(); return $result; } Loading Loading @@ -116,5 +102,4 @@ class CorpsService { return $result; } } module/Application/src/Application/Service/Corps/CorpsServiceAwareTrait.php +2 −2 Original line number Diff line number Diff line Loading @@ -10,7 +10,7 @@ trait CorpsServiceAwareTrait { /** * @return CorpsService */ public function getCorpsService() public function getCorpsService() : CorpsService { return $this->corpsService; } Loading @@ -19,7 +19,7 @@ trait CorpsServiceAwareTrait { * @param CorpsService $corpsService * @return CorpsService */ public function setCorpsService($corpsService) public function setCorpsService(CorpsService $corpsService) : CorpsService { $this->corpsService = $corpsService; return $this->corpsService; Loading module/Application/src/Application/Service/Correspondance/CorrespondanceService.php +8 −2 Original line number Diff line number Diff line Loading @@ -45,9 +45,15 @@ class CorrespondanceService { return $result; } public function getCorrespondancesAsOptions() /** * @param string $champ * @param string $ordre * @param bool $avecAgent * @return array */ public function getCorrespondancesAsOptions(string $champ = 'categorie', string $ordre = 'ASC', bool $avecAgent=false) { $correspondances = $this->getCorrespondances(); $correspondances = $this->getCorrespondances($champ, $ordre, $avecAgent); $options = []; foreach($correspondances as $correspondance) { $options[$correspondance->getId()] = $correspondance->getCategorie() . " - " . $correspondance->getLibelleLong(); Loading Loading
module/Application/src/Application/Service/Categorie/CategorieService.php +2 −4 Original line number Diff line number Diff line Loading @@ -11,8 +11,6 @@ use Zend\Mvc\Controller\AbstractActionController; class CategorieService { // use UserServiceAwareTrait; // use EntityManagerAwareTrait; use GestionEntiteHistorisationTrait; /** GESTION DES ENTITES *******************************************************************************************/ Loading Loading @@ -129,7 +127,7 @@ class CategorieService * @param string $param * @return Categorie */ public function getRequestedCategorie($controller, $param='categorie') public function getRequestedCategorie(AbstractActionController $controller, $param='categorie') { $id = $controller->params()->fromRoute($param); $result = $this->getCategorie($id); Loading @@ -140,7 +138,7 @@ class CategorieService * @param string $code * @return Categorie */ public function getCategorieByCode($code) public function getCategorieByCode(string $code) { $qb = $this->createQueryBuider() ->andWhere('categorie.code = :code') Loading
module/Application/src/Application/Service/Categorie/CategorieServiceAwareTrait.php +2 −2 Original line number Diff line number Diff line Loading @@ -10,7 +10,7 @@ trait CategorieServiceAwareTrait { /** * @return CategorieService */ public function getCategorieService() public function getCategorieService() : CategorieService { return $this->categorieService; } Loading @@ -19,7 +19,7 @@ trait CategorieServiceAwareTrait { * @param CategorieService $categorieService * @return CategorieService */ public function setCategorieService($categorieService) public function setCategorieService(CategorieService $categorieService) : CategorieService { $this->categorieService = $categorieService; return $this->categorieService; Loading
module/Application/src/Application/Service/Corps/CorpsService.php +2 −17 Original line number Diff line number Diff line Loading @@ -35,7 +35,8 @@ class CorpsService { * @return QueryBuilder */ public function createQueryBuilder() { $qb = $this->getEntityManager()->getRepository(Corps::class)->createQueryBuilder('corps'); $qb = $this->getEntityManager()->getRepository(Corps::class)->createQueryBuilder('corps') ; return $qb; } Loading @@ -58,21 +59,6 @@ class CorpsService { ; } $result = $qb->getQuery()->getResult(); return $result; } /** * @param string $champ * @param string $ordre * @return Corps[] */ public function getCorpsHistorises($champ = 'libelleLong', $ordre = 'ASC') { $qb = $this->createQueryBuilder() ->andWhere('corps.histo IS NOT NULL') ->orderBy('corps.' . $champ, $ordre) ; $result = $qb->getQuery()->getResult(); return $result; } Loading Loading @@ -116,5 +102,4 @@ class CorpsService { return $result; } }
module/Application/src/Application/Service/Corps/CorpsServiceAwareTrait.php +2 −2 Original line number Diff line number Diff line Loading @@ -10,7 +10,7 @@ trait CorpsServiceAwareTrait { /** * @return CorpsService */ public function getCorpsService() public function getCorpsService() : CorpsService { return $this->corpsService; } Loading @@ -19,7 +19,7 @@ trait CorpsServiceAwareTrait { * @param CorpsService $corpsService * @return CorpsService */ public function setCorpsService($corpsService) public function setCorpsService(CorpsService $corpsService) : CorpsService { $this->corpsService = $corpsService; return $this->corpsService; Loading
module/Application/src/Application/Service/Correspondance/CorrespondanceService.php +8 −2 Original line number Diff line number Diff line Loading @@ -45,9 +45,15 @@ class CorrespondanceService { return $result; } public function getCorrespondancesAsOptions() /** * @param string $champ * @param string $ordre * @param bool $avecAgent * @return array */ public function getCorrespondancesAsOptions(string $champ = 'categorie', string $ordre = 'ASC', bool $avecAgent=false) { $correspondances = $this->getCorrespondances(); $correspondances = $this->getCorrespondances($champ, $ordre, $avecAgent); $options = []; foreach($correspondances as $correspondance) { $options[$correspondance->getId()] = $correspondance->getCategorie() . " - " . $correspondance->getLibelleLong(); Loading