Loading module/Formation/config/others/formation.config.php +2 −2 Changes for module/Formation/config/others/formation.config.php: 2 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -133,10 +133,10 @@ return [ ], ], 'ajouter' => [ 'type' => Literal::class, 'type' => Segment::class, 'may_terminate' => true, 'options' => [ 'route' => '/ajouter', 'route' => '/ajouter[/:module]', 'defaults' => [ 'controller' => FormationController::class, 'action' => 'ajouter', Loading module/Formation/src/Formation/Controller/FormationController.php +5 −1 Changes for module/Formation/src/Formation/Controller/FormationController.php: 5 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -5,6 +5,7 @@ namespace Formation\Controller; use Application\Controller\AbstractController; use Application\Service\Etablissement\EtablissementServiceAwareTrait; use Formation\Entity\Db\Formation; use Formation\Entity\Db\Module; use Formation\Form\Formation\FormationFormAwareTrait; use Formation\Service\Formation\FormationServiceAwareTrait; use UnicaenApp\Service\EntityManagerAwareTrait; Loading Loading @@ -57,10 +58,13 @@ class FormationController extends AbstractController public function ajouterAction() { $module = $this->getEntityManager()->getRepository(Module::class)->getRequestedModule($this); $formation = new Formation(); if ($module !== null) $formation->setModule($module); $form = $this->getFormationForm(); $form->setAttribute('action', $this->url()->fromRoute('formation/formation/ajouter', [], [], true)); $form->setAttribute('action', $this->url()->fromRoute('formation/formation/ajouter', ['module' => $module->getId()], [], true)); $form->bind($formation); $request = $this->getRequest(); Loading module/Formation/src/Formation/Entity/Db/Mapping/Formation.Entity.Db.Formation.dcm.xml +1 −1 Changes for module/Formation/src/Formation/Entity/Db/Mapping/Formation.Entity.Db.Formation.dcm.xml: 1 added line, 1 removed line. Original line number Diff line number Diff line Loading @@ -10,7 +10,7 @@ </id> <field name="libelle" type="string" length="1024" column="LIBELLE" nullable="false"/> <field name="description" type="string" length="9999" column="DESCRIPTION" nullable="true"/> <field name="lien" type="string" length="1024" column="LIEN" nullable="true"/> <field name="lien" type="string" length="9999" column="LIEN" nullable="true"/> <one-to-many field="sessions" target-entity="Formation\Entity\Db\Session" mapped-by="formation"/> Loading module/Formation/src/Formation/Entity/Db/Mapping/Formation.Entity.Db.Module.dcm.xml +1 Changes for module/Formation/src/Formation/Entity/Db/Mapping/Formation.Entity.Db.Module.dcm.xml: 1 added line, 0 removed lines. Original line number Diff line number Diff line Loading @@ -10,6 +10,7 @@ </id> <field name="libelle" type="string" length="1024" column="LIBELLE" nullable="false"/> <field name="description" type="string" length="9999" column="DESCRIPTION" nullable="true"/> <field name="lien" type="string" length="9999" column="LIEN" nullable="true"/> <one-to-many field="formations" target-entity="Formation\Entity\Db\Formation" mapped-by="module"/> Loading module/Formation/src/Formation/Entity/Db/Module.php +20 Changes for module/Formation/src/Formation/Entity/Db/Module.php: 20 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -18,6 +18,8 @@ class Module implements HistoriqueAwareInterface /** @var string|null */ private $description; /** @var string|null */ private $lien; /** @var Collection (Formation) */ private $formations; Loading Loading @@ -66,6 +68,24 @@ class Module implements HistoriqueAwareInterface return $this; } /** * @return string|null */ public function getLien(): ?string { return $this->lien; } /** * @param string|null $lien * @return Module */ public function setLien(?string $lien): Module { $this->lien = $lien; return $this; } /** * @return Collection */ Loading Loading
module/Formation/config/others/formation.config.php +2 −2 Changes for module/Formation/config/others/formation.config.php: 2 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -133,10 +133,10 @@ return [ ], ], 'ajouter' => [ 'type' => Literal::class, 'type' => Segment::class, 'may_terminate' => true, 'options' => [ 'route' => '/ajouter', 'route' => '/ajouter[/:module]', 'defaults' => [ 'controller' => FormationController::class, 'action' => 'ajouter', Loading
module/Formation/src/Formation/Controller/FormationController.php +5 −1 Changes for module/Formation/src/Formation/Controller/FormationController.php: 5 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -5,6 +5,7 @@ namespace Formation\Controller; use Application\Controller\AbstractController; use Application\Service\Etablissement\EtablissementServiceAwareTrait; use Formation\Entity\Db\Formation; use Formation\Entity\Db\Module; use Formation\Form\Formation\FormationFormAwareTrait; use Formation\Service\Formation\FormationServiceAwareTrait; use UnicaenApp\Service\EntityManagerAwareTrait; Loading Loading @@ -57,10 +58,13 @@ class FormationController extends AbstractController public function ajouterAction() { $module = $this->getEntityManager()->getRepository(Module::class)->getRequestedModule($this); $formation = new Formation(); if ($module !== null) $formation->setModule($module); $form = $this->getFormationForm(); $form->setAttribute('action', $this->url()->fromRoute('formation/formation/ajouter', [], [], true)); $form->setAttribute('action', $this->url()->fromRoute('formation/formation/ajouter', ['module' => $module->getId()], [], true)); $form->bind($formation); $request = $this->getRequest(); Loading
module/Formation/src/Formation/Entity/Db/Mapping/Formation.Entity.Db.Formation.dcm.xml +1 −1 Changes for module/Formation/src/Formation/Entity/Db/Mapping/Formation.Entity.Db.Formation.dcm.xml: 1 added line, 1 removed line. Original line number Diff line number Diff line Loading @@ -10,7 +10,7 @@ </id> <field name="libelle" type="string" length="1024" column="LIBELLE" nullable="false"/> <field name="description" type="string" length="9999" column="DESCRIPTION" nullable="true"/> <field name="lien" type="string" length="1024" column="LIEN" nullable="true"/> <field name="lien" type="string" length="9999" column="LIEN" nullable="true"/> <one-to-many field="sessions" target-entity="Formation\Entity\Db\Session" mapped-by="formation"/> Loading
module/Formation/src/Formation/Entity/Db/Mapping/Formation.Entity.Db.Module.dcm.xml +1 Changes for module/Formation/src/Formation/Entity/Db/Mapping/Formation.Entity.Db.Module.dcm.xml: 1 added line, 0 removed lines. Original line number Diff line number Diff line Loading @@ -10,6 +10,7 @@ </id> <field name="libelle" type="string" length="1024" column="LIBELLE" nullable="false"/> <field name="description" type="string" length="9999" column="DESCRIPTION" nullable="true"/> <field name="lien" type="string" length="9999" column="LIEN" nullable="true"/> <one-to-many field="formations" target-entity="Formation\Entity\Db\Formation" mapped-by="module"/> Loading
module/Formation/src/Formation/Entity/Db/Module.php +20 Changes for module/Formation/src/Formation/Entity/Db/Module.php: 20 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -18,6 +18,8 @@ class Module implements HistoriqueAwareInterface /** @var string|null */ private $description; /** @var string|null */ private $lien; /** @var Collection (Formation) */ private $formations; Loading Loading @@ -66,6 +68,24 @@ class Module implements HistoriqueAwareInterface return $this; } /** * @return string|null */ public function getLien(): ?string { return $this->lien; } /** * @param string|null $lien * @return Module */ public function setLien(?string $lien): Module { $this->lien = $lien; return $this; } /** * @return Collection */ Loading