src/Entity/OffreAccueil/PresentationMAM.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity\OffreAccueil;
  3. use \JsonSerializable;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Symfony\Component\Validator\Constraints as Assert;
  6. /**
  7.  * @ORM\Entity
  8.  * @ORM\Table(name="efc.oa_mam_presentation")
  9.  */
  10. class PresentationMAM implements JsonSerializable
  11. {
  12.     use \App\Entity\Commun\IdTrait;
  13.     /**
  14.      * @Assert\NotNull()
  15.      * @ORM\OneToOne(targetEntity="App\Entity\MAM\MAM", inversedBy="presentation_mam")
  16.      * @ORM\JoinColumn(name="id_mam", referencedColumnName="id", nullable=false)
  17.      */
  18.     private $mam;
  19.     /**
  20.      * @ORM\Column(type="string", length=600, nullable=true)
  21.      */
  22.     private $texte_libre;
  23.     /**
  24.      * @ORM\Column(type="string", length=600, nullable=true)
  25.      */
  26.     private $texte_libre_mod;
  27.     /**
  28.      * @ORM\Column(type="string", length=1, nullable=true)
  29.      * @Assert\Regex(pattern="/^[FPEI]$/", message="Fixe, Portable, Email, Indetermine")
  30.      */
  31.     private $mode_contact_prefere;
  32.     /**
  33.      * @ORM\Column(type="string", length=5, nullable=true)
  34.      * @Assert\Regex(pattern="/^$|^(0[0-9]|1[0-9]|2[0-3]|[0-9]):[0-5][0-9]$/", message="Saisir une heure au format HH:MM")
  35.      */
  36.     private $heure_contact_matin_deb;
  37.     /**
  38.      * @ORM\Column(type="string", length=5, nullable=true)
  39.      * @Assert\Regex(pattern="/^$|^(0[0-9]|1[0-9]|2[0-3]|[0-9]):[0-5][0-9]$/", message="Saisir une heure au format HH:MM")
  40.      */
  41.     private $heure_contact_matin_fin;
  42.     /**
  43.      * @ORM\Column(type="string", length=5, nullable=true)
  44.      * @Assert\Regex(pattern="/^$|^(0[0-9]|1[0-9]|2[0-3]|[0-9]):[0-5][0-9]$/", message="Saisir une heure au format HH:MM")
  45.      */
  46.     private $heure_contact_aprem_deb;
  47.     /**
  48.      * @ORM\Column(type="string", length=5, nullable=true)
  49.      * @Assert\Regex(pattern="/^$|^(0[0-9]|1[0-9]|2[0-3]|[0-9]):[0-5][0-9]$/", message="Saisir une heure au format HH:MM")
  50.      */
  51.     private $heure_contact_aprem_fin;
  52.     /**
  53.      * Indique si l'mam accepte d'accueillir les enfants tot le matin (accueil atypique au sens du cerfa)
  54.      * @ORM\Column(type="boolean", nullable=false, options={"default":false})
  55.      */
  56.     private $accepte_atypique_matin;
  57.     /**
  58.      * Indique si l'mam accepte d'accueillir les enfants tard le soir (accueil atypique au sens du cerfa)
  59.      * @ORM\Column(type="boolean", nullable=false, options={"default":false})
  60.      */
  61.     private $accepte_atypique_soir;
  62.     /**
  63.      * Indique si l'mam accepte d'accueillir les enfants en situation de handicap (au sens du cerfa)
  64.      * @ORM\Column(type="boolean", nullable=false, options={"default":false})
  65.      */
  66.     private $accepte_handicap;
  67.     use \App\Entity\Commun\DateCreationTrait;
  68.     use \App\Entity\Commun\DateModificationTrait;
  69.     /**
  70.      * Get mam
  71.      *
  72.      * @return MAM
  73.      */
  74.     public function getMAM()
  75.     {
  76.         return $this->mam;
  77.     }
  78.     /**
  79.      * Set mam
  80.      *
  81.      * @param mam $mam
  82.      * 
  83.      * @return PresentationMAM
  84.      */
  85.     public function setMAM($mam)
  86.     {
  87.         $this->mam $mam;
  88.         return $this;
  89.     }
  90.     /**
  91.      * Get texte_libre
  92.      *
  93.      * @return string
  94.      */
  95.     public function getTexteLibre()
  96.     {
  97.         return $this->texte_libre;
  98.     }
  99.     /**
  100.      * Set texte_libre
  101.      *
  102.      * @param string $texte_libre
  103.      *
  104.      * @return PresentationMAM
  105.      */
  106.     public function setTexteLibre($texte_libre)
  107.     {
  108.         $this->texte_libre $texte_libre;
  109.         return $this;
  110.     }
  111.     /**
  112.      * Get texte_libre_mod
  113.      *
  114.      * @return string
  115.      */
  116.     public function getTexteLibreMod()
  117.     {
  118.         return $this->texte_libre_mod;
  119.     }
  120.     /**
  121.      * Set texte_libre_mod
  122.      *
  123.      * @param string $texte_libre_mod
  124.      *
  125.      * @return PresentationMAM
  126.      */
  127.     public function setTexteLibreMod($texte_libre_mod)
  128.     {
  129.         $this->texte_libre_mod $texte_libre_mod;
  130.         return $this;
  131.     }
  132.     /**
  133.      * Get formation_continue
  134.      *
  135.      * @return string
  136.      */
  137.     public function getFormationContinue()
  138.     {
  139.         return $this->formation_continue;
  140.     }
  141.     /**
  142.      * Set formation_continue
  143.      *
  144.      * @param string $formation_continue
  145.      *
  146.      * @return PresentationMAM
  147.      */
  148.     public function setFormationContinue($formation_continue)
  149.     {
  150.         $this->formation_continue $formation_continue;
  151.         return $this;
  152.     }
  153.     /**
  154.      * Get formation_continue_mod
  155.      *
  156.      * @return string
  157.      */
  158.     public function getFormationContinueMod()
  159.     {
  160.         return $this->formation_continue_mod;
  161.     }
  162.     /**
  163.      * Set formation_continue_mod
  164.      *
  165.      * @param string $formation_continue_mod
  166.      *
  167.      * @return PresentationMAM
  168.      */
  169.     public function setFormationContinueMod($formation_continue_mod)
  170.     {
  171.         $this->formation_continue_mod $formation_continue_mod;
  172.         return $this;
  173.     }
  174.     /**
  175.      * Get mode_contact_prefere
  176.      *
  177.      * @return string
  178.      */
  179.     public function getModeContactPrefere()
  180.     {
  181.         return $this->mode_contact_prefere;
  182.     }
  183.     /**
  184.      * Set mode_contact_prefere
  185.      *
  186.      * @param string $mode_contact_prefere
  187.      *
  188.      * @return PresentationMAM
  189.      */
  190.     public function setModeContactPrefere($mode_contact_prefere)
  191.     {
  192.         $this->mode_contact_prefere $mode_contact_prefere;
  193.         return $this;
  194.     }
  195.     /**
  196.      * Obtient le libellé pour le mode de contact préféré
  197.      *
  198.      * @return void
  199.      */
  200.     function getModeContactPrefereTexte()
  201.     {
  202.         switch ($this->mode_contact_prefere) {
  203.             case 'F':
  204.                 $texte "téléphone fixe";
  205.                 break;
  206.             case 'P':
  207.                 $texte "téléphone portable";
  208.                 break;
  209.             case 'E':
  210.                 $texte "courrier électronique";
  211.                 break;
  212.             default:
  213.                 $texte "non précisé";
  214.                 break;
  215.         }
  216.         return $texte;
  217.     }
  218.     /**
  219.      * Get heure_contact_matin_deb
  220.      *
  221.      * @return string
  222.      */
  223.     public function getHeureContactMatinDeb()
  224.     {
  225.         return $this->heure_contact_matin_deb;
  226.     }
  227.     /**
  228.      * Set heure_contact_matin_deb
  229.      *
  230.      * @param string $heure_contact_matin_deb
  231.      *
  232.      * @return PresentationMAM
  233.      */
  234.     public function setHeureContactMatinDeb($heure_contact_matin_deb)
  235.     {
  236.         $this->heure_contact_matin_deb $heure_contact_matin_deb;
  237.         return $this;
  238.     }
  239.     /**
  240.      * Get heure_contact_matin_fin
  241.      *
  242.      * @return string
  243.      */
  244.     public function getHeureContactMatinFin()
  245.     {
  246.         return $this->heure_contact_matin_fin;
  247.     }
  248.     /**
  249.      * Set heure_contact_matin_fin
  250.      *
  251.      * @param string $heure_contact_matin_fin
  252.      *
  253.      * @return PresentationMAM
  254.      */
  255.     public function setHeureContactMatinFin($heure_contact_matin_fin)
  256.     {
  257.         $this->heure_contact_matin_fin $heure_contact_matin_fin;
  258.         return $this;
  259.     }
  260.     /**
  261.      * Get heure_contact_aprem_deb
  262.      *
  263.      * @return string
  264.      */
  265.     public function getHeureContactApremDeb()
  266.     {
  267.         return $this->heure_contact_aprem_deb;
  268.     }
  269.     /**
  270.      * Set heure_contact_aprem_deb
  271.      *
  272.      * @param string $heure_contact_aprem_deb
  273.      *
  274.      * @return PresentationMAM
  275.      */
  276.     public function setHeureContactApremDeb($heure_contact_aprem_deb)
  277.     {
  278.         $this->heure_contact_aprem_deb $heure_contact_aprem_deb;
  279.         return $this;
  280.     }
  281.     /**
  282.      * Get heure_contact_aprem_fin
  283.      *
  284.      * @return string
  285.      */
  286.     public function getHeureContactApremFin()
  287.     {
  288.         return $this->heure_contact_aprem_fin;
  289.     }
  290.     /**
  291.      * Set heure_contact_aprem_fin
  292.      *
  293.      * @param string $heure_contact_aprem_fin
  294.      *
  295.      * @return PresentationMAM
  296.      */
  297.     public function setHeureContactApremFin($heure_contact_aprem_fin)
  298.     {
  299.         $this->heure_contact_aprem_fin $heure_contact_aprem_fin;
  300.         return $this;
  301.     }
  302.     /**
  303.      * Get accepte_atypique_matin
  304.      *
  305.      * @return bool
  306.      */
  307.     public function getAccepteAtypiqueMatin()
  308.     {
  309.         return $this->accepte_atypique_matin;
  310.     }
  311.     /**
  312.      * Set accepte_atypique_matin
  313.      *
  314.      * @param bool $accepte_atypique_matin
  315.      *
  316.      * @return PresentationMAM
  317.      */
  318.     public function setAccepteAtypiqueMatin($accepte_atypique_matin)
  319.     {
  320.         $this->accepte_atypique_matin $accepte_atypique_matin;
  321.         return $this;
  322.     }
  323.     /**
  324.      * Get accepte_atypique_soir
  325.      *
  326.      * @return bool
  327.      */
  328.     public function getAccepteAtypiqueSoir()
  329.     {
  330.         return $this->accepte_atypique_soir;
  331.     }
  332.     /**
  333.      * Set accepte_atypique_soir
  334.      *
  335.      * @param bool $accepte_atypique_soir
  336.      *
  337.      * @return PresentationMAM
  338.      */
  339.     public function setAccepteAtypiqueSoir($accepte_atypique_soir)
  340.     {
  341.         $this->accepte_atypique_soir $accepte_atypique_soir;
  342.         return $this;
  343.     }
  344.     /**
  345.      * Get accepte_handicap
  346.      *
  347.      * @return bool
  348.      */
  349.     public function getAccepteHandicap()
  350.     {
  351.         return $this->accepte_handicap;
  352.     }
  353.     /**
  354.      * Set accepte_handicap
  355.      *
  356.      * @param bool $accepte_handicap
  357.      *
  358.      * @return PresentationMAM
  359.      */
  360.     public function setAccepteHandicap($accepte_handicap)
  361.     {
  362.         $this->accepte_handicap $accepte_handicap;
  363.         return $this;
  364.     }
  365.     /*
  366.      * Implémentation de JsonSerializable
  367.      * Ne liste que les champs modifiables par les utilisateurs
  368.      * @return json de la presentation
  369.      */
  370.     public function jsonSerialize()
  371.     {
  372.         return [
  373.             'texte_libre' => $this->texte_libre,
  374.             'texte_libre_mod' => $this->texte_libre_mod,
  375.         ];
  376.     }
  377.     /**
  378.      * Obtient une nouvelle instance de PresentationAssmat, initialisée à partir du tableau associatif fourni en paramètre
  379.      *
  380.      * @param array $data
  381.      * @return PresentationAssmat
  382.      */
  383.     public static function createFromArray(array $data)
  384.     {
  385.         $newInstance = new PresentationMAM();
  386.         return $newInstance->initFromArray($data);
  387.     }
  388.     /**
  389.      * mappe les propriétés sur l'instance à partir d'un tableau associatif
  390.      *
  391.      * @param array $data
  392.      * @return void
  393.      */
  394.     public function initFromArray(array $data)
  395.     {
  396.         foreach ($data as $prop => $value) {
  397.             $this->{$prop} = $value;
  398.         }
  399.         return $this;
  400.     }
  401. }