<?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_assmat_presentation")
*/
class PresentationAssmat implements JsonSerializable
{
use \App\Entity\Commun\IdTrait;
/**
* @Assert\NotNull()
* @ORM\OneToOne(targetEntity="App\Entity\AssistantMaternel\AssistantMaternel", inversedBy="presentation_assmat")
* @ORM\JoinColumn(name="id_assmat", referencedColumnName="id", nullable=false)
*/
private $assmat;
/**
* @ORM\Column(type="string", length=600, nullable=true)
* @Assert\Length(
* max = 600,
* maxMessage = "Votre message est trop long."
* )
*/
private $texte_libre;
/**
* @ORM\Column(type="string", length=600, nullable=true)
* @Assert\Length(
* max = 600,
* maxMessage = "Votre message est trop long."
* )
*/
private $texte_libre_mod;
/**
* @ORM\Column(type="string", length=600, nullable=true)
* @Assert\Length(
* max = 600,
* maxMessage = "Votre message est trop long."
* )
*/
private $formation_continue;
/**
* @ORM\Column(type="string", length=600, nullable=true)
* @Assert\Length(
* max = 600,
* maxMessage = "Votre message est trop long."
* )
*/
private $formation_continue_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'assmat 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'assmat 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'assmat 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;
/**
* @ORM\Column(type="datetime")
*/
private $date_saisie_projet;
/**
* Get assmat
*
* @return Assmat
*/
public function getAssmat()
{
return $this->assmat;
}
/**
* Set assmat
*
* @param Assmat $assmat
*
* @return PresentationAssmat
*/
public function setAssmat($assmat)
{
$this->assmat = $assmat;
return $this;
}
/**
* Get texte_libre
*
* @return string
*/
public function getTexteLibre()
{
return $this->texte_libre;
}
/**
* Set texte_libre
*
* @param string $texte_libre
*
* @return PresentationAssmat
*/
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 PresentationAssmat
*/
public function setTexteLibreMod($texte_libre_mod)
{
//enregistre date de saisie du projet d'accueil pou rlea 1ere fois
if ($this->texte_libre_mod != $texte_libre_mod
&& $this->date_saisie_projet == null
&& ($this->texte_libre_mod == '' || $this->texte_libre_mod == null)) {
$this->date_saisie_projet = new \DateTime();
}
$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 PresentationAssmat
*/
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 PresentationAssmat
*/
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 PresentationAssmat
*/
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 PresentationAssmat
*/
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 PresentationAssmat
*/
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 PresentationAssmat
*/
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 PresentationAssmat
*/
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 PresentationAssmat
*/
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 PresentationAssmat
*/
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 PresentationAssmat
*/
public function setAccepteHandicap($accepte_handicap)
{
$this->accepte_handicap = $accepte_handicap;
return $this;
}
/**
* Get date_saisie_projet
*
* @return date saisie projet accueil (texte libre pas vide)
*/
public function getDateSaisieProjet()
{
return $this->date_saisie_projet;
}
/**
* Set date_saisie_projet
*
* @param Date $dateSaisieProjet
*
*/
public function setDateSaisieProjet($dateSaisieProjet)
{
$this->date_saisie_projet = $dateSaisieProjet;
return $this;
}
/*
* Implémentation de JsonSerializable
* Ne liste que les champs modifiables par les utilisateurs
*/
public function jsonSerialize()
{
return [
'texte_libre' => $this->texte_libre,
'texte_libre_mod' => $this->texte_libre_mod,
'formation_continue' => $this->formation_continue,
'formation_continue_mod' => $this->formation_continue_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 PresentationAssmat();
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;
}
}