Skip to content
Snippets Groups Projects
Select Git revision
  • b2ad85165978efd9d42ec8fd1976bf5b0208a006
  • master default protected
  • ll-workflow
  • alc-scindage-donnees-pj
  • b24
  • FJ_LL_Tbl_Contrat
  • alc-docker-node
  • ll-apiplatform
  • php84
  • ll-rgpd
  • b23
  • alc-filtre-type-intervenant
  • ll-sans-mdb5
  • formules-ancienne-infra
  • ll-formules
  • alc-intervenant-dmep
  • ll-suppr-v_vol-s
  • b20
  • ll-postgresql
  • b23.0.1
  • b22
  • 24.8
  • 24.7
  • 24.6
  • 24.5
  • 24.4
  • 24.3
  • 24.2
  • 24.1
  • 24.0
  • 23.15
  • 24.0-beta19
  • 24.0-beta18
  • 24.0-beta17
  • 24.0-beta16
  • 24.0-beta15
  • 24.0-beta14
  • 24.0-beta13
  • 23.14
  • 24.0-beta12
  • 24.0-beta11
41 results

IntervenantViewHelper.php

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    IntervenantViewHelper.php 4.82 KiB
    <?php
    
    namespace Application\View\Helper\Intervenant;
    
    use Application\Constants;
    use Zend\View\Helper\AbstractHtmlElement;
    use Application\Entity\Db\Intervenant;
    use Application\Entity\Db\Traits\IntervenantAwareTrait;
    
    /**
     * Description of Intervenant
     *
     * @author Laurent LÉCLUSE <laurent.lecluse at unicaen.fr>
     */
    class IntervenantViewHelper extends AbstractHtmlElement
    {
        use IntervenantAwareTrait;
    
    
    
        /**
         *
         * @param Intervenant $intervenant
         *
         * @return self
         */
        public function __invoke(Intervenant $intervenant = null)
        {
            if ($intervenant) $this->setIntervenant($intervenant);
    
            return $this;
        }
    
    
    
        public function __toString()
        {
            return $this->render();
        }
    
    
    
        /**
         *
         *
         * @return string Code HTML
         */
        public function render()
        {
            $entity = $this->getIntervenant();
    
            if (!$entity) {
                return '';
            }
    
            $vars = [
                'identite'    => [
                    "NOM prénom"           => $entity,
                    "Civilité"             => (string)$entity->getCivilite(),
                    "Date de naissance"    => (string)$entity->getDateNaissance()->format(Constants::DATE_FORMAT),
                    "Commune de naissance" => (string)$entity->getCommuneNaissance() ?: '<span class="inconnu">(Inconnue)</span>',
                    "Pays de naissance"    => (string)$entity->getPaysNaissance(),
                ],
                'coordonnees' => [
                    "Email"           => $entity->getEmailPro() ?: '<span class="inconnu">(Inconnu)</span>',
                    "Téléphone perso" => $entity->getTelPerso() ?: '<span class="inconnu">(Inconnu)</span>',
                    "Téléphone pro"   => $entity->getTelPro() ?: '<span class="inconnu">(Inconnu)</span>',
                    "Adresse"         => nl2br($entity->getAdresse(false)),
                ],
                'metier'      => [