<?php
namespace App\Entity\OffreAccueil;
use \JsonSerializable;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
/**
* @ORM\Entity
* @ORM\Table(name="efc.oa_mam_presentation")
*/
class PresentationMAM implements JsonSerializable
{
use \App\Entity\Commun\IdTrait;
/**
* @Assert\NotNull()
* @ORM\OneToOne(targetEntity="App\Entity\MAM\MAM", inversedBy="presentation_mam")
* @ORM\JoinColumn(name="id_mam", referencedColumnName="id", nullable=false)
*/
private $mam;
/**
* @ORM\Column(type="string", length=600, nullable=true)
*/
private $texte_libre;
/**
* @ORM\Column(type="string", length=600, nullable=true)
*/
private $texte_libre_mod;
/**
* @ORM\Column(type="string", length=1, nullable=true)
* @Assert\Regex(pattern="/^[FPEI]$/", message="Fixe, Portable, Email, Indetermine")
*/
private $mode_contact_prefere;
/**
* @ORM\Column(type="string", length=5, nullable=true)
* @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")
*/
private $heure_contact_matin_deb;
/**
* @ORM\Column(type="string", length=5, nullable=true)
* @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")
*/
private $heure_contact_matin_fin;
/**
* @ORM\Column(type="string", length=5, nullable=true)
* @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")
*/
private $heure_contact_aprem_deb;
/**
* @ORM\Column(type="string", length=5, nullable=true)
* @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")
*/
private $heure_contact_aprem_fin;
/**
* Indique si l'mam accepte d'accueillir les enfants tot le matin (accueil atypique au sens du cerfa)
* @ORM\Column(type="boolean", nullable=false, options={"default":false})
*/
private $accepte_atypique_matin;
/**
* Indique si l'mam accepte d'accueillir les enfants tard le soir (accueil atypique au sens du cerfa)
* @ORM\Column(type="boolean", nullable=false, options={"default":false})
*/
private $accepte_atypique_soir;
/**
* Indique si l'mam accepte d'accueillir les enfants en situation de handicap (au sens du cerfa)
* @ORM\Column(type="boolean", nullable=false, options={"default":false})
*/
private $accepte_handicap;
use \App\Entity\Commun\DateCreationTrait;
use \App\Entity\Commun\DateModificationTrait;
/**
* Get mam
*
* @return MAM
*/
public function getMAM()
{
return $this->mam;
}
/**
* Set mam
*
* @param mam $mam
*
* @return PresentationMAM
*/
public function setMAM($mam)
{
$this->mam = $mam;
return $this;
}
/**
* Get texte_libre
*
* @return string
*/
public function getTexteLibre()
{
return $this->texte_libre;
}
/**
* Set texte_libre
*
* @param string $texte_libre
*
* @return PresentationMAM
*/
public function setTexteLibre($texte_libre)
{
$this->texte_libre = $texte_libre;
return $this;
}
/**
* Get texte_libre_mod
*
* @return string
*/
public function getTexteLibreMod()
{
return $this->texte_libre_mod;
}
/**
* Set texte_libre_mod
*
* @param string $texte_libre_mod
*
* @return PresentationMAM
*/
public function setTexteLibreMod($texte_libre_mod)
{
$this->texte_libre_mod = $texte_libre_mod;
return $this;
}
/**
* Get formation_continue
*
* @return string
*/
public function getFormationContinue()
{
return $this->formation_continue;
}
/**
* Set formation_continue
*
* @param string $formation_continue
*
* @return PresentationMAM
*/
public function setFormationContinue($formation_continue)
{
$this->formation_continue = $formation_continue;
return $this;
}
/**
* Get formation_continue_mod
*
* @return string
*/
public function getFormationContinueMod()
{
return $this->formation_continue_mod;
}
/**
* Set formation_continue_mod
*
* @param string $formation_continue_mod
*
* @return PresentationMAM
*/
public function setFormationContinueMod($formation_continue_mod)
{
$this->formation_continue_mod = $formation_continue_mod;
return $this;
}
/**
* Get mode_contact_prefere
*
* @return string
*/
public function getModeContactPrefere()
{
return $this->mode_contact_prefere;
}
/**
* Set mode_contact_prefere
*
* @param string $mode_contact_prefere
*
* @return PresentationMAM
*/
public function setModeContactPrefere($mode_contact_prefere)
{
$this->mode_contact_prefere = $mode_contact_prefere;
return $this;
}
/**
* Obtient le libellé pour le mode de contact préféré
*
* @return void
*/
function getModeContactPrefereTexte()
{
switch ($this->mode_contact_prefere) {
case 'F':
$texte = "téléphone fixe";
break;
case 'P':
$texte = "téléphone portable";
break;
case 'E':
$texte = "courrier électronique";
break;
default:
$texte = "non précisé";
break;
}
return $texte;
}
/**
* Get heure_contact_matin_deb
*
* @return string
*/
public function getHeureContactMatinDeb()
{
return $this->heure_contact_matin_deb;
}
/**
* Set heure_contact_matin_deb
*
* @param string $heure_contact_matin_deb
*
* @return PresentationMAM
*/
public function setHeureContactMatinDeb($heure_contact_matin_deb)
{
$this->heure_contact_matin_deb = $heure_contact_matin_deb;
return $this;
}
/**
* Get heure_contact_matin_fin
*
* @return string
*/
public function getHeureContactMatinFin()
{
return $this->heure_contact_matin_fin;
}
/**
* Set heure_contact_matin_fin
*
* @param string $heure_contact_matin_fin
*
* @return PresentationMAM
*/
public function setHeureContactMatinFin($heure_contact_matin_fin)
{
$this->heure_contact_matin_fin = $heure_contact_matin_fin;
return $this;
}
/**
* Get heure_contact_aprem_deb
*
* @return string
*/
public function getHeureContactApremDeb()
{
return $this->heure_contact_aprem_deb;
}
/**
* Set heure_contact_aprem_deb
*
* @param string $heure_contact_aprem_deb
*
* @return PresentationMAM
*/
public function setHeureContactApremDeb($heure_contact_aprem_deb)
{
$this->heure_contact_aprem_deb = $heure_contact_aprem_deb;
return $this;
}
/**
* Get heure_contact_aprem_fin
*
* @return string
*/
public function getHeureContactApremFin()
{
return $this->heure_contact_aprem_fin;
}
/**
* Set heure_contact_aprem_fin
*
* @param string $heure_contact_aprem_fin
*
* @return PresentationMAM
*/
public function setHeureContactApremFin($heure_contact_aprem_fin)
{
$this->heure_contact_aprem_fin = $heure_contact_aprem_fin;
return $this;
}
/**
* Get accepte_atypique_matin
*
* @return bool
*/
public function getAccepteAtypiqueMatin()
{
return $this->accepte_atypique_matin;
}
/**
* Set accepte_atypique_matin
*
* @param bool $accepte_atypique_matin
*
* @return PresentationMAM
*/
public function setAccepteAtypiqueMatin($accepte_atypique_matin)
{
$this->accepte_atypique_matin = $accepte_atypique_matin;
return $this;
}
/**
* Get accepte_atypique_soir
*
* @return bool
*/
public function getAccepteAtypiqueSoir()
{
return $this->accepte_atypique_soir;
}
/**
* Set accepte_atypique_soir
*
* @param bool $accepte_atypique_soir
*
* @return PresentationMAM
*/
public function setAccepteAtypiqueSoir($accepte_atypique_soir)
{
$this->accepte_atypique_soir = $accepte_atypique_soir;
return $this;
}
/**
* Get accepte_handicap
*
* @return bool
*/
public function getAccepteHandicap()
{
return $this->accepte_handicap;
}
/**
* Set accepte_handicap
*
* @param bool $accepte_handicap
*
* @return PresentationMAM
*/
public function setAccepteHandicap($accepte_handicap)
{
$this->accepte_handicap = $accepte_handicap;
return $this;
}
/*
* Implémentation de JsonSerializable
* Ne liste que les champs modifiables par les utilisateurs
* @return json de la presentation
*/
public function jsonSerialize()
{
return [
'texte_libre' => $this->texte_libre,
'texte_libre_mod' => $this->texte_libre_mod,
];
}
/**
* Obtient une nouvelle instance de PresentationAssmat, initialisée à partir du tableau associatif fourni en paramètre
*
* @param array $data
* @return PresentationAssmat
*/
public static function createFromArray(array $data)
{
$newInstance = new PresentationMAM();
return $newInstance->initFromArray($data);
}
/**
* mappe les propriétés sur l'instance à partir d'un tableau associatif
*
* @param array $data
* @return void
*/
public function initFromArray(array $data)
{
foreach ($data as $prop => $value) {
$this->{$prop} = $value;
}
return $this;
}
}