Commit c2126f84 authored by Jean-Philippe Metivier's avatar Jean-Philippe Metivier
Browse files

Lien entre individu et mail de contact, ajout du mail dans l'export

parent 99b9b594
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@ 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()); },
            //These
            'Identifiant de la thèse'               => function (These $these) { return $these->getSourceCode(); },
+25 −0
Original line number Diff line number Diff line
@@ -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,15 @@ class Individu implements HistoriqueAwareInterface, SourceAwareInterface
     */
    private $id;

    /**
     * @var ArrayCollection (mailContact)
     */
    private $mailsConfirmations;


    public function __construct() {
        $this->mailsConfirmations = new ArrayCollection();
    }
    /**
     * @return string
     * @see supannId
@@ -445,4 +455,19 @@ 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;
    }
}
 No newline at end of file
+2 −1
Original line number Diff line number Diff line
@@ -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"/>