Loading module/Application/src/Application/Entity/Db/Etape.php +2 −1 Changes for module/Application/src/Application/Entity/Db/Etape.php: 2 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -309,7 +309,8 @@ class Etape implements HistoriqueAwareInterface, AnneeAwareInterface, ResourceIn /** * Get cheminPedagogique * * @return \Doctrine\Common\Collections\Collection * @return \Doctrine\Common\Collections\Collection|CheminPedagogique[] * */ public function getCheminPedagogique() { Loading module/Application/src/Application/Service/EtapeService.php +15 −10 Changes for module/Application/src/Application/Service/EtapeService.php: 15 added lines, 10 removed lines. Original line number Diff line number Diff line Loading @@ -2,19 +2,16 @@ namespace Application\Service; use Application\Entity\Db\Structure; use Application\Entity\Db\Annee; use Application\Entity\Db\ElementPedagogique; use Application\Provider\Privilege\Privileges; use Application\Service\Traits\CheminPedagogiqueServiceAwareTrait; use Application\Service\Traits\ContextServiceAwareTrait; use Application\Service\Traits\GroupeTypeFormationServiceAwareTrait; use Application\Service\Traits\StructureServiceAwareTrait; use Application\Service\Traits\TypeFormationServiceAwareTrait; use BjyAuthorize\Exception\UnAuthorizedException; use Doctrine\ORM\Query\Expr\Join; use Doctrine\ORM\QueryBuilder; use Application\Entity\Db\Etape; use Zend\Form\Element; /** * Description of ElementPedagogique Loading @@ -22,7 +19,7 @@ use Zend\Form\Element; * @author Laurent LÉCLUSE <laurent.lecluse at unicaen.fr> * * @method Etape get($id) * @method Etape[] getList(\Doctrine\ORM\QueryBuilder $qb = null, $alias = null) * @method Etape[] getList(QueryBuilder $qb = null, $alias = null) */ class EtapeService extends AbstractEntityService { Loading @@ -33,6 +30,7 @@ class EtapeService extends AbstractEntityService use GroupeTypeFormationServiceAwareTrait; use StructureServiceAwareTrait; use ContextServiceAwareTrait; use CheminPedagogiqueServiceAwareTrait; Loading Loading @@ -96,8 +94,7 @@ class EtapeService extends AbstractEntityService $stmt->execute(); $result = $stmt->fetchAll(); $etapes = []; foreach($result as $etape) { foreach ($result as $etape) { $etapes[$etape['ETAPE_CODE']] = $etape; } Loading @@ -105,6 +102,7 @@ class EtapeService extends AbstractEntityService } /** * Retour uniquement les Etapes ayant été reconduites pour l'année universitaire suivante * et possédant des modulateurs à reconduire Loading Loading @@ -140,8 +138,7 @@ class EtapeService extends AbstractEntityService $stmt->execute(); $result = $stmt->fetchAll(); $etapes = []; foreach($result as $etape) { foreach ($result as $etape) { $etapes[$etape['ETAPE_CODE']] = $etape; } Loading @@ -150,7 +147,6 @@ class EtapeService extends AbstractEntityService /** * * @param \Application\Entity\NiveauEtape $niveau Loading Loading @@ -311,6 +307,15 @@ class EtapeService extends AbstractEntityService throw new UnAuthorizedException('Vous n\'êtes pas autorisé(e) à supprimer cette formation.'); } foreach ($entity->getCheminPedagogique() as $cp) { if ($cp->estNonHistorise()) { /* @var $cp \Application\Entity\Db\CheminPedagogique */ $cp->getElementPedagogique()->removeCheminPedagogique($cp); $entity->removeCheminPedagogique($cp); $this->getServiceCheminPedagogique()->delete($cp); } } return parent::delete($entity, $softDelete); } Loading Loading
module/Application/src/Application/Entity/Db/Etape.php +2 −1 Changes for module/Application/src/Application/Entity/Db/Etape.php: 2 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -309,7 +309,8 @@ class Etape implements HistoriqueAwareInterface, AnneeAwareInterface, ResourceIn /** * Get cheminPedagogique * * @return \Doctrine\Common\Collections\Collection * @return \Doctrine\Common\Collections\Collection|CheminPedagogique[] * */ public function getCheminPedagogique() { Loading
module/Application/src/Application/Service/EtapeService.php +15 −10 Changes for module/Application/src/Application/Service/EtapeService.php: 15 added lines, 10 removed lines. Original line number Diff line number Diff line Loading @@ -2,19 +2,16 @@ namespace Application\Service; use Application\Entity\Db\Structure; use Application\Entity\Db\Annee; use Application\Entity\Db\ElementPedagogique; use Application\Provider\Privilege\Privileges; use Application\Service\Traits\CheminPedagogiqueServiceAwareTrait; use Application\Service\Traits\ContextServiceAwareTrait; use Application\Service\Traits\GroupeTypeFormationServiceAwareTrait; use Application\Service\Traits\StructureServiceAwareTrait; use Application\Service\Traits\TypeFormationServiceAwareTrait; use BjyAuthorize\Exception\UnAuthorizedException; use Doctrine\ORM\Query\Expr\Join; use Doctrine\ORM\QueryBuilder; use Application\Entity\Db\Etape; use Zend\Form\Element; /** * Description of ElementPedagogique Loading @@ -22,7 +19,7 @@ use Zend\Form\Element; * @author Laurent LÉCLUSE <laurent.lecluse at unicaen.fr> * * @method Etape get($id) * @method Etape[] getList(\Doctrine\ORM\QueryBuilder $qb = null, $alias = null) * @method Etape[] getList(QueryBuilder $qb = null, $alias = null) */ class EtapeService extends AbstractEntityService { Loading @@ -33,6 +30,7 @@ class EtapeService extends AbstractEntityService use GroupeTypeFormationServiceAwareTrait; use StructureServiceAwareTrait; use ContextServiceAwareTrait; use CheminPedagogiqueServiceAwareTrait; Loading Loading @@ -96,8 +94,7 @@ class EtapeService extends AbstractEntityService $stmt->execute(); $result = $stmt->fetchAll(); $etapes = []; foreach($result as $etape) { foreach ($result as $etape) { $etapes[$etape['ETAPE_CODE']] = $etape; } Loading @@ -105,6 +102,7 @@ class EtapeService extends AbstractEntityService } /** * Retour uniquement les Etapes ayant été reconduites pour l'année universitaire suivante * et possédant des modulateurs à reconduire Loading Loading @@ -140,8 +138,7 @@ class EtapeService extends AbstractEntityService $stmt->execute(); $result = $stmt->fetchAll(); $etapes = []; foreach($result as $etape) { foreach ($result as $etape) { $etapes[$etape['ETAPE_CODE']] = $etape; } Loading @@ -150,7 +147,6 @@ class EtapeService extends AbstractEntityService /** * * @param \Application\Entity\NiveauEtape $niveau Loading Loading @@ -311,6 +307,15 @@ class EtapeService extends AbstractEntityService throw new UnAuthorizedException('Vous n\'êtes pas autorisé(e) à supprimer cette formation.'); } foreach ($entity->getCheminPedagogique() as $cp) { if ($cp->estNonHistorise()) { /* @var $cp \Application\Entity\Db\CheminPedagogique */ $cp->getElementPedagogique()->removeCheminPedagogique($cp); $entity->removeCheminPedagogique($cp); $this->getServiceCheminPedagogique()->delete($cp); } } return parent::delete($entity, $softDelete); } Loading