Loading src/Octopus/Entity/Db/Individu.php +17 −1 Original line number Diff line number Diff line Loading @@ -47,12 +47,15 @@ class Individu implements SearchIndividuResultInterface { /** @var DateTime */ private $dateModification; /** @var ArrayCollection */ /** @var ArrayCollection (IndividuAffectation) */ private $affectations; /** @var ArrayCollection (IndividuInscription) */ private $inscriptions; public function __construct() { $this->affectations = new ArrayCollection(); $this->inscriptions = new ArrayCollection(); } Loading Loading @@ -222,6 +225,19 @@ class Individu implements SearchIndividuResultInterface { return $affectations; } /** * @return IndividuInscription[] */ public function getInscriptions() { $inscriptions = $this->inscriptions->toArray(); usort($inscriptions, function (IndividuInscription $a, IndividuInscription $b) { return $a->getAnnee() > $b->getAnnee();}); return $inscriptions; } /** * @return string */ public function __toString() { $texte = $this->getPrenom(); Loading src/Octopus/Entity/Db/Mapping/Octopus.Entity.Db.Individu.dcm.xml +1 −0 Original line number Diff line number Diff line Loading @@ -33,6 +33,7 @@ <field name="dateModification" type="date" column="D_MODIF" nullable="false"/> <one-to-many target-entity="Octopus\Entity\Db\IndividuAffectation" mapped-by="individu" field="affectations"/> <one-to-many target-entity="Octopus\Entity\Db\IndividuInscription" mapped-by="individu" field="inscriptions"/> </entity> </doctrine-mapping> No newline at end of file Loading
src/Octopus/Entity/Db/Individu.php +17 −1 Original line number Diff line number Diff line Loading @@ -47,12 +47,15 @@ class Individu implements SearchIndividuResultInterface { /** @var DateTime */ private $dateModification; /** @var ArrayCollection */ /** @var ArrayCollection (IndividuAffectation) */ private $affectations; /** @var ArrayCollection (IndividuInscription) */ private $inscriptions; public function __construct() { $this->affectations = new ArrayCollection(); $this->inscriptions = new ArrayCollection(); } Loading Loading @@ -222,6 +225,19 @@ class Individu implements SearchIndividuResultInterface { return $affectations; } /** * @return IndividuInscription[] */ public function getInscriptions() { $inscriptions = $this->inscriptions->toArray(); usort($inscriptions, function (IndividuInscription $a, IndividuInscription $b) { return $a->getAnnee() > $b->getAnnee();}); return $inscriptions; } /** * @return string */ public function __toString() { $texte = $this->getPrenom(); Loading
src/Octopus/Entity/Db/Mapping/Octopus.Entity.Db.Individu.dcm.xml +1 −0 Original line number Diff line number Diff line Loading @@ -33,6 +33,7 @@ <field name="dateModification" type="date" column="D_MODIF" nullable="false"/> <one-to-many target-entity="Octopus\Entity\Db\IndividuAffectation" mapped-by="individu" field="affectations"/> <one-to-many target-entity="Octopus\Entity\Db\IndividuInscription" mapped-by="individu" field="inscriptions"/> </entity> </doctrine-mapping> No newline at end of file