diff --git a/module/Application/src/Application/Controller/ExportController.php b/module/Application/src/Application/Controller/ExportController.php index 604c0fb541c18fb434460324bc47c5c306be223f..41e4410db912531b651462d5365be8e7f6ea1b4e 100644 --- a/module/Application/src/Application/Controller/ExportController.php +++ b/module/Application/src/Application/Controller/ExportController.php @@ -30,7 +30,9 @@ class ExportController extends AbstractController 'Date de naissance' => function (These $these) { return $these->getDoctorant()->getIndividu()->getDateNaissance(); }, 'Nationalité' => function (These $these) { return $these->getDoctorant()->getIndividu()->getNationalite(); }, 'Adresse électronique' => function (These $these) { return $these->getDoctorant()->getIndividu()->getEmail(); }, + 'Adresse électronique personnelle' => function (These $these) { return $these->getDoctorant()->getIndividu()->getMailContact(); }, 'Numéro étudiant' => function (These $these) { return $this->sourceCodeStringHelper->removePrefixFrom($these->getDoctorant()->getSourceCode()); }, + 'I.N.E.' => function (These $these) { return $these->getDoctorant()->getIndividu()->getIne(); }, //These 'Identifiant de la thèse' => function (These $these) { return $these->getSourceCode(); }, 'Titre' => function (These $these) { return $these->getTitre(); }, diff --git a/module/Application/src/Application/Entity/Db/Individu.php b/module/Application/src/Application/Entity/Db/Individu.php index da3553aa9c001bb4935e9e69e0596863ef88b650..4fed8ff0560a7ffb1a96df068bef966070e2b903 100644 --- a/module/Application/src/Application/Entity/Db/Individu.php +++ b/module/Application/src/Application/Entity/Db/Individu.php @@ -4,6 +4,7 @@ namespace Application\Entity\Db; use Application\Constants; use Application\Filter\NomCompletFormatter; +use Doctrine\Common\Collections\ArrayCollection; use UnicaenApp\Entity\HistoriqueAwareInterface; use UnicaenApp\Entity\HistoriqueAwareTrait; use UnicaenImport\Entity\Db\Interfaces\SourceAwareInterface; @@ -92,6 +93,20 @@ class Individu implements HistoriqueAwareInterface, SourceAwareInterface */ private $id; + /** + * @var ArrayCollection (mailContact) + */ + private $mailsConfirmations; + + /** + * @var string + */ + private $ine; + + + public function __construct() { + $this->mailsConfirmations = new ArrayCollection(); + } /** * @return string * @see supannId @@ -445,4 +460,39 @@ class Individu implements HistoriqueAwareInterface, SourceAwareInterface { return $this->id; } + + /** @return string */ + public function getMailContact() + { + if (! $this->mailsConfirmations->isEmpty()) + { + /** @var MailConfirmation $mailConfirmation */ + foreach ($this->mailsConfirmations as $mailConfirmation) { + if ($mailConfirmation->getEtat() === MailConfirmation::CONFIRMER) { + return $mailConfirmation->getEmail(); + } + } + } + return null; + } + + /** + * @return string + */ + public function getIne() + { + return $this->ine; + } + + /** + * @param string $ine + * @return Individu + */ + public function setIne($ine) + { + $this->ine = $ine; + return $this; + } + + } \ No newline at end of file diff --git a/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.Individu.dcm.xml b/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.Individu.dcm.xml index c56887c9c1420032816c215819cb2ed21120d9b7..04c22529e68112f46e882a5c41be211a6eac9b7d 100644 --- a/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.Individu.dcm.xml +++ b/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.Individu.dcm.xml @@ -21,10 +21,11 @@ <field name="sourceCode" column="SOURCE_CODE" nullable="true"/> + <one-to-many target-entity="Application\Entity\Db\MailConfirmation" mapped-by="individu" field="mailsConfirmations"/> + <field name="histoCreation" type="datetime" column="HISTO_CREATION"/> <field name="histoDestruction" type="datetime" column="HISTO_DESTRUCTION" nullable="true"/> <field name="histoModification" type="datetime" column="HISTO_MODIFICATION"/> - <many-to-one field="source" target-entity="Application\Entity\Db\Source"> <join-columns> <join-column name="SOURCE_ID" referenced-column-name="ID"/>