<?php
namespace App\Entity\Vetoadom;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
/**
* Referant
*
* @ORM\Table(name="referant", uniqueConstraints={@ORM\UniqueConstraint(name="nom", columns={"nom"})}, indexes={@ORM\Index(name="FK_referant_ville", columns={"ville_id"})})
* @ORM\Entity(repositoryClass="App\Repository\Vetoadom\ReferantRepository")
* @ORM\HasLifecycleCallbacks()
* @UniqueEntity(
* groups={"nom"},
* fields={"nom"},
* errorPath="nom",
* message="page_referants_horaires_consignes_modifier.referant_nom_exist"
* )
*/
class Referant
{
/**
* @var int
*
* @ORM\Column(name="id", type="integer", nullable=false)
* @ORM\Id
* @ORM\GeneratedValue(strategy="IDENTITY")
*/
private $id;
/**
* @var string
*
* @ORM\Column(name="nom", type="string", length=190, nullable=false)
* @Assert\NotBlank(
* groups={"nom"},
* message="common.blank"
* )
* @Assert\Length(
* groups={"nom"},
* max=190,
* maxMessage="common.too_long"
* )
*/
private $nom;
/**
* @var string
*
* @ORM\Column(name="adresse", type="string", length=38, nullable=false)
* @Assert\NotBlank(
* groups={"adresse"},
* message="common.blank"
* )
* @Assert\Length(
* groups={"adresse"},
* max=38,
* maxMessage="common.too_long"
* )
*/
private $adresse;
/**
* @var string|null
*
* @ORM\Column(name="consigne", type="text", length=65535, nullable=true)
* @Assert\Length(
* groups={"consigne"},
* max=65535,
* maxMessage="common.too_long"
* )
*/
private $consigne;
/**
* @var string|null
*
* @ORM\Column(name="informations_horaires", type="text", length=65535, nullable=true)
* @Assert\Length(
* groups={"informationsHoraires"},
* max=65535,
* maxMessage="common.too_long"
* )
*/
private $informationsHoraires;
/**
* @var string|null
*
* @ORM\Column(name="informations_conges", type="text", length=65535, nullable=true)
* @Assert\Length(
* groups={"informationsConges"},
* max=65535,
* maxMessage="common.too_long"
* )
*/
private $informationsConges;
/**
* @var \DateTime|null
*
* @ORM\Column(name="horaire_special_debut", type="date", nullable=true)
*/
private $horaireSpecialDebut;
/**
* @var \DateTime|null
*
* @ORM\Column(name="horaire_special_fin", type="date", nullable=true)
*/
private $horaireSpecialFin;
/**
* @var string|null
*
* @ORM\Column(name="consignes_generales", type="text", length=65535, nullable=true)
* @Assert\Length(
* groups={"consignesGenerales"},
* max=65535,
* maxMessage="common.too_long"
* )
*/
private $consignesGenerales;
/**
* @var string|null
*
* @ORM\Column(name="consignes_post_operatoire_suivi", type="text", length=65535, nullable=true)
* @Assert\Length(
* groups={"consignesPostOperatoireSuivi"},
* max=65535,
* maxMessage="common.too_long"
* )
*/
private $consignesPostOperatoireSuivi;
/**
* @var string|null
*
* @ORM\Column(name="hospitalisation1", type="string", length=190, nullable=true)
* @Assert\Length(
* groups={"hospitalisation1"},
* max=190,
* maxMessage="common.too_long"
* )
*/
private $hospitalisation1;
/**
* @var string|null
*
* @ORM\Column(name="hospitalisation2", type="string", length=190, nullable=true)
* @Assert\Length(
* groups={"hospitalisation2"},
* max=190,
* maxMessage="common.too_long"
* )
*/
private $hospitalisation2;
/**
* @var string|null
*
* @ORM\Column(name="hospitalisation3", type="string", length=190, nullable=true)
* @Assert\Length(
* groups={"hospitalisation3"},
* max=190,
* maxMessage="common.too_long"
* )
*/
private $hospitalisation3;
/**
* @var string|null
*
* @ORM\Column(name="cas_general", type="string", length=190, nullable=true)
* @Assert\Length(
* groups={"casGeneral"},
* max=190,
* maxMessage="common.too_long"
* )
*/
private $casGeneral;
/**
* @var string|null
*
* @ORM\Column(name="chirurgie_osseuse", type="string", length=190, nullable=true)
* @Assert\Length(
* groups={"chirurgieOsseuse"},
* max=190,
* maxMessage="common.too_long"
* )
*/
private $chirurgieOsseuse;
/**
* @var string|null
*
* @ORM\Column(name="chirurgie_tissu_mou", type="string", length=190, nullable=true)
* @Assert\Length(
* groups={"chirurgieTissuMou"},
* max=190,
* maxMessage="common.too_long"
* )
*/
private $chirurgieTissuMou;
/**
* @var string|null
*
* @ORM\Column(name="scanner", type="string", length=190, nullable=true)
* @Assert\Length(
* groups={"scanner"},
* max=190,
* maxMessage="common.too_long"
* )
*/
private $scanner;
/**
* @var string|null
*
* @ORM\Column(name="transfusion", type="string", length=190, nullable=true)
* @Assert\Length(
* groups={"transfusion"},
* max=190,
* maxMessage="common.too_long"
* )
*/
private $transfusion;
/**
* @var string|null
*
* @ORM\Column(name="endoscopie", type="string", length=190, nullable=true)
* @Assert\Length(
* groups={"endoscopie"},
* max=190,
* maxMessage="common.too_long"
* )
*/
private $endoscopie;
/**
* @var string|null
*
* @ORM\Column(name="externe_id", type="string", length=8, nullable=true)
* @Assert\Length(
* groups={"externeId"},
* max=8,
* maxMessage="common.too_long"
* )
*/
private $externeId;
/**
* @var string|null
*
* @ORM\Column(name="sda", type="string", length=10, nullable=true, options={"fixed"=true})
* @Assert\Regex(
* groups={"sda"},
* pattern="/^\d{10}$/",
* message="common.format_wrong"
* )
*/
private $sda;
/**
* @var bool
*
* @ORM\Column(name="continuite_soin", type="boolean", nullable=false)
*/
private $continuiteSoin = '0';
/**
* @var bool
*
* @ORM\Column(name="envoi_cr_email", type="boolean", nullable=false)
*/
private $envoiCrEmail = '0';
/**
* @var bool
*
* @ORM\Column(name="envoi_message", type="boolean", nullable=false)
*/
private $envoiMessage = '0';
/**
* @var string|null
*
* @ORM\Column(name="informations_internes", type="text", length=65535, nullable=true)
* @Assert\Length(
* groups={"informationsInternes"},
* max=65535,
* maxMessage="common.too_long"
* )
*/
private $informationsInternes;
/**
* @var \DateTime|null
*
* @ORM\Column(name="alerte_regulateur_date_debut", type="date", nullable=true)
* @Assert\NotBlank(
* groups={"alerteRegulateurDateDebut"},
* message="common.blank"
* )
*/
private $alerteRegulateurDateDebut;
/**
* @var \DateTime|null
*
* @ORM\Column(name="alerte_regulateur_date_fin", type="date", nullable=true)
* @Assert\NotBlank(
* groups={"alerteRegulateurDateFin"},
* message="common.blank"
* )
*/
private $alerteRegulateurDateFin;
/**
* @var string|null
*
* @ORM\Column(name="alerte_regulateur_motif", type="text", length=65535, nullable=true)
* @Assert\NotBlank(
* groups={"alerteRegulateurMotif"},
* message="common.blank"
* )
* @Assert\Length(
* groups={"alerteRegulateurMotif"},
* max=65535,
* maxMessage="common.too_long"
* )
*/
private $alerteRegulateurMotif;
/**
* @var int
*
* @ORM\Column(name="associe_responsable_id", type="integer", nullable=true)
*/
private $associeResponsableId;
/**
* @var \DateTime|null
*
* @ORM\Column(name="date_derniere_visite", type="date", nullable=true)
*/
private $dateDerniereVisite;
/**
* @var string|null
*
* @ORM\Column(name="suivi_marketing", type="text", length=65535, nullable=true)
* @Assert\Length(
* groups={"suiviMarketing"},
* max=65535,
* maxMessage="common.too_long"
* )
*/
private $suiviMarketing;
/**
* @var string|null
*
* @ORM\Column(name="test_ligne", type="string", length=190, nullable=true)
* @Assert\Length(
* groups={"testLigne"},
* max=190,
* maxMessage="common.too_long"
* )
*/
private $testLigne;
/**
* @var \DateTime|null
*
* @ORM\Column(name="date_recontacte", type="date", nullable=true)
*/
private $dateRecontacte;
/**
* @var \DateTime
*
* @ORM\Column(name="date_creation", type="datetime", nullable=false)
*/
private $dateCreation;
/**
* @var \DateTime
*
* @ORM\Column(name="date_modification", type="datetime", nullable=false, options={"default"="CURRENT_TIMESTAMP"})
*/
private $dateModification;
/**
* @var \Ville
*
* @ORM\ManyToOne(targetEntity="Ville")
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="ville_id", referencedColumnName="id")
* })
* @Assert\NotBlank(
* groups={"ville"},
* message="common.blank"
* )
*/
private $ville;
/**
* One SecteurZone has many Document. This is the inverse side.
* @ORM\OneToMany(targetEntity="Document", mappedBy="referant")
*/
private $documents;
/**
* @var Collection
*
* One Referant has many ReferantConges. This is the inverse side.
* @ORM\OneToMany(targetEntity="ReferantConges", mappedBy="referant")
* @ORM\OrderBy({"dateDebut" = "ASC"})
*/
private $referantConges;
/**
* @var Collection
*
* One Referant has many ReferantEmail. This is the inverse side.
* @ORM\OneToMany(targetEntity="ReferantEmail", mappedBy="referant")
*/
private $referantEmail;
/**
* @var Collection
*
* One Referant has many ReferantEquipe. This is the inverse side.
* @ORM\OneToMany(targetEntity="ReferantEquipe", mappedBy="referant")
*/
private $referantEquipe;
/**
* @var Collection
*
* One Referant has many ReferantFiltrageClient. This is the inverse side.
* @ORM\OneToMany(targetEntity="ReferantFiltrageClient", mappedBy="referant")
*/
private $referantFiltrageClient;
/**
* @var Collection
*
* One Referant has many ReferantHoraire. This is the inverse side.
* @ORM\OneToMany(targetEntity="ReferantHoraire", mappedBy="referant")
*/
private $referantHoraire;
/**
* @var Collection
*
* One Referant has many ReferantTelephone. This is the inverse side.
* @ORM\OneToMany(targetEntity="ReferantTelephone", mappedBy="referant")
*/
private $referantTelephone;
/**
* Constructor
*/
public function __construct()
{
$this->documents = new ArrayCollection();
$this->referantConges = new ArrayCollection();
$this->referantEmail = new ArrayCollection();
$this->referantEquipe = new ArrayCollection();
$this->referantFiltrageClient = new ArrayCollection();
$this->referantHoraire = new ArrayCollection();
$this->referantTelephone = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getNom(): ?string
{
return $this->nom;
}
public function setNom(string $nom): self
{
$this->nom = $nom;
return $this;
}
public function getAdresse(): ?string
{
return $this->adresse;
}
public function setAdresse(string $adresse): self
{
$this->adresse = $adresse;
return $this;
}
public function getConsigne(): ?string
{
return $this->consigne;
}
public function setConsigne(?string $consigne): self
{
if ($consigne === '') $consigne = null;
$this->consigne = $consigne;
return $this;
}
public function getInformationsHoraires(): ?string
{
return $this->informationsHoraires;
}
public function setInformationsHoraires(?string $informationsHoraires): self
{
if ($informationsHoraires === '') $informationsHoraires = null;
$this->informationsHoraires = $informationsHoraires;
return $this;
}
public function getInformationsConges(): ?string
{
return $this->informationsConges;
}
public function setInformationsConges(?string $informationsConges): self
{
if ($informationsConges === '') $informationsConges = null;
$this->informationsConges = $informationsConges;
return $this;
}
public function getHoraireSpecialDebut(): ?\DateTimeInterface
{
return $this->horaireSpecialDebut;
}
public function setHoraireSpecialDebut(?\DateTimeInterface $horaireSpecialDebut): self
{
$this->horaireSpecialDebut = $horaireSpecialDebut;
return $this;
}
public function getHoraireSpecialFin(): ?\DateTimeInterface
{
return $this->horaireSpecialFin;
}
public function setHoraireSpecialFin(?\DateTimeInterface $horaireSpecialFin): self
{
$this->horaireSpecialFin = $horaireSpecialFin;
return $this;
}
public function getConsignesGenerales(): ?string
{
return $this->consignesGenerales;
}
public function setConsignesGenerales(?string $consignesGenerales): self
{
if ($consignesGenerales === '') $consignesGenerales = null;
$this->consignesGenerales = $consignesGenerales;
return $this;
}
public function getConsignesPostOperatoireSuivi(): ?string
{
return $this->consignesPostOperatoireSuivi;
}
public function setConsignesPostOperatoireSuivi(?string $consignesPostOperatoireSuivi): self
{
if ($consignesPostOperatoireSuivi === '') $consignesPostOperatoireSuivi = null;
$this->consignesPostOperatoireSuivi = $consignesPostOperatoireSuivi;
return $this;
}
public function getHospitalisation1(): ?string
{
return $this->hospitalisation1;
}
public function setHospitalisation1(?string $hospitalisation1): self
{
if ($hospitalisation1 === '') $hospitalisation1 = null;
$this->hospitalisation1 = $hospitalisation1;
return $this;
}
public function getHospitalisation2(): ?string
{
return $this->hospitalisation2;
}
public function setHospitalisation2(?string $hospitalisation2): self
{
if ($hospitalisation2 === '') $hospitalisation2 = null;
$this->hospitalisation2 = $hospitalisation2;
return $this;
}
public function getHospitalisation3(): ?string
{
return $this->hospitalisation3;
}
public function setHospitalisation3(?string $hospitalisation3): self
{
if ($hospitalisation3 === '') $hospitalisation3 = null;
$this->hospitalisation3 = $hospitalisation3;
return $this;
}
public function getCasGeneral(): ?string
{
return $this->casGeneral;
}
public function setCasGeneral(?string $casGeneral): self
{
if ($casGeneral === '') $casGeneral = null;
$this->casGeneral = $casGeneral;
return $this;
}
public function getChirurgieOsseuse(): ?string
{
return $this->chirurgieOsseuse;
}
public function setChirurgieOsseuse(?string $chirurgieOsseuse): self
{
if ($chirurgieOsseuse === '') $chirurgieOsseuse = null;
$this->chirurgieOsseuse = $chirurgieOsseuse;
return $this;
}
public function getChirurgieTissuMou(): ?string
{
return $this->chirurgieTissuMou;
}
public function setChirurgieTissuMou(?string $chirurgieTissuMou): self
{
if ($chirurgieTissuMou === '') $chirurgieTissuMou = null;
$this->chirurgieTissuMou = $chirurgieTissuMou;
return $this;
}
public function getScanner(): ?string
{
return $this->scanner;
}
public function setScanner(?string $scanner): self
{
if ($scanner === '') $scanner = null;
$this->scanner = $scanner;
return $this;
}
public function getTransfusion(): ?string
{
return $this->transfusion;
}
public function setTransfusion(?string $transfusion): self
{
if ($transfusion === '') $transfusion = null;
$this->transfusion = $transfusion;
return $this;
}
public function getEndoscopie(): ?string
{
return $this->endoscopie;
}
public function setEndoscopie(?string $endoscopie): self
{
if ($endoscopie === '') $endoscopie = null;
$this->endoscopie = $endoscopie;
return $this;
}
public function getExterneId(): ?string
{
return $this->externeId;
}
public function setExterneId(?string $externeId): self
{
if ($externeId === '') $externeId = null;
$this->externeId = $externeId;
return $this;
}
public function getSda(): ?string
{
return $this->sda;
}
public function setSda(?string $sda): self
{
if ($sda === '') $sda = null;
$this->sda = $sda;
return $this;
}
public function getContinuiteSoin(): ?bool
{
return $this->continuiteSoin;
}
public function setContinuiteSoin(bool $continuiteSoin): self
{
$this->continuiteSoin = $continuiteSoin;
return $this;
}
public function getEnvoiCrEmail(): ?bool
{
return $this->envoiCrEmail;
}
public function setEnvoiCrEmail(bool $envoiCrEmail): self
{
$this->envoiCrEmail = $envoiCrEmail;
return $this;
}
public function getEnvoiMessage(): ?bool
{
return $this->envoiMessage;
}
public function setEnvoiMessage(bool $envoiMessage): self
{
$this->envoiMessage = $envoiMessage;
return $this;
}
public function getInformationsInternes(): ?string
{
return $this->informationsInternes;
}
public function setInformationsInternes(?string $informationsInternes): self
{
if ($informationsInternes === '') $informationsInternes = null;
$this->informationsInternes = $informationsInternes;
return $this;
}
public function getAlerteRegulateurDateDebut(): ?\DateTimeInterface
{
return $this->alerteRegulateurDateDebut;
}
public function setAlerteRegulateurDateDebut(?\DateTimeInterface $alerteRegulateurDateDebut): self
{
$this->alerteRegulateurDateDebut = $alerteRegulateurDateDebut;
return $this;
}
public function getAlerteRegulateurDateFin(): ?\DateTimeInterface
{
return $this->alerteRegulateurDateFin;
}
public function setAlerteRegulateurDateFin(?\DateTimeInterface $alerteRegulateurDateFin): self
{
$this->alerteRegulateurDateFin = $alerteRegulateurDateFin;
return $this;
}
public function getAlerteRegulateurMotif(): ?string
{
return $this->alerteRegulateurMotif;
}
public function setAlerteRegulateurMotif(?string $alerteRegulateurMotif): self
{
if ($alerteRegulateurMotif === '') $alerteRegulateurMotif = null;
$this->alerteRegulateurMotif = $alerteRegulateurMotif;
return $this;
}
public function getAssocieResponsableId(): ?int
{
return $this->associeResponsableId;
}
public function setAssocieResponsableId(?int $associeResponsableId): self
{
$this->associeResponsableId = $associeResponsableId;
return $this;
}
public function getDateDerniereVisite(): ?\DateTimeInterface
{
return $this->dateDerniereVisite;
}
public function setDateDerniereVisite(?\DateTimeInterface $dateDerniereVisite): self
{
$this->dateDerniereVisite = $dateDerniereVisite;
return $this;
}
public function getSuiviMarketing(): ?string
{
return $this->suiviMarketing;
}
public function setSuiviMarketing(?string $suiviMarketing): self
{
if ($suiviMarketing === '') $suiviMarketing = null;
$this->suiviMarketing = $suiviMarketing;
return $this;
}
public function getTestLigne(): ?string
{
return $this->testLigne;
}
public function setTestLigne(?string $testLigne): self
{
if ($testLigne === '') $testLigne = null;
$this->testLigne = $testLigne;
return $this;
}
public function getDateRecontacte(): ?\DateTimeInterface
{
return $this->dateRecontacte;
}
public function setDateRecontacte(?\DateTimeInterface $dateRecontacte): self
{
$this->dateRecontacte = $dateRecontacte;
return $this;
}
public function getDateCreation(): ?\DateTimeInterface
{
return $this->dateCreation;
}
public function setDateCreation(\DateTimeInterface $dateCreation): self
{
$this->dateCreation = $dateCreation;
return $this;
}
public function getDateModification(): ?\DateTimeInterface
{
return $this->dateModification;
}
public function setDateModification(\DateTimeInterface $dateModification): self
{
$this->dateModification = $dateModification;
return $this;
}
public function getVille(): ?Ville
{
return $this->ville;
}
public function setVille(?Ville $ville): self
{
$this->ville = $ville;
return $this;
}
/**
* Helpers
*/
/**
* @return Collection|Document[]
*/
public function getDocumentsCollection(): Collection
{
return $this->documents;
}
/**
* @param string $type
* @return Collection|Document[]
*/
public function getDocumentsActiveByType(string $type): Collection
{
return $this->getDocumentsCollection()->filter(function (Document $document) use ($type){
return $document->getActive() && $document->getDocumentType()->getType() == $type;
});
}
/**
* @return Collection|ReferantConges[]
*/
public function getReferantCongesCollection(): Collection
{
return $this->referantConges;
}
/**
* @param int $id
* @return bool
*/
public function hasReferantCongesById(int $id): bool
{
return $this->getReferantCongesCollection()->filter(function (ReferantConges $referantConges) use ($id){
return $referantConges->getId() == $id;
})->count() == 1;
}
/**
* @param int $id
* @return ReferantConges
* @throws \Exception
*/
public function getReferantCongesById(int $id): ReferantConges
{
return $this->getReferantCongesCollection()->filter(function (ReferantConges $referantConges) use ($id){
return $referantConges->getId() == $id;
})->first();
}
/**
* @return Collection|ReferantEmail[]
*/
public function getReferantEmailCollection(): Collection
{
return $this->referantEmail;
}
/**
* @param int $id
* @return bool
*/
public function hasReferantEmailById(int $id): bool
{
return $this->getReferantEmailCollection()->filter(function (ReferantEmail $referantEmail) use ($id){
return $referantEmail->getId() == $id;
})->count() == 1;
}
/**
* @param int $id
* @return ReferantEmail
* @throws \Exception
*/
public function getReferantEmailById(int $id): ReferantEmail
{
return $this->getReferantEmailCollection()->filter(function (ReferantEmail $referantEmail) use ($id){
return $referantEmail->getId() == $id;
})->first();
}
/**
* @return Collection|ReferantEquipe[]
*/
public function getReferantEquipeCollection(): Collection
{
return $this->referantEquipe;
}
/**
* @param int $id
* @return bool
*/
public function hasReferantEquipeById(int $id): bool
{
return $this->getReferantEquipeCollection()->filter(function (ReferantEquipe $referantEquipe) use ($id){
return $referantEquipe->getId() == $id;
})->count() == 1;
}
/**
* @param int $id
* @return ReferantEquipe
* @throws \Exception
*/
public function getReferantEquipeById(int $id): ReferantEquipe
{
return $this->getReferantEquipeCollection()->filter(function (ReferantEquipe $referantEquipe) use ($id){
return $referantEquipe->getId() == $id;
})->first();
}
/**
* @return Collection|ReferantFiltrageClient[]
*/
public function getReferantFiltrageClientCollection(): Collection
{
return $this->referantFiltrageClient->filter(function (ReferantFiltrageClient $referantFiltrageClient){
return $referantFiltrageClient->getActive();
});
}
/**
* @param int $id
* @return bool
*/
public function hasReferantFiltrageClientById(int $id): bool
{
return $this->getReferantFiltrageClientCollection()->filter(function (ReferantFiltrageClient $referantFiltrageClient) use ($id){
return $referantFiltrageClient->getId() == $id;
})->count() == 1;
}
/**
* @param int $id
* @return ReferantFiltrageClient
* @throws \Exception
*/
public function getReferantFiltrageClientById(int $id): ReferantFiltrageClient
{
return $this->getReferantFiltrageClientCollection()->filter(function (ReferantFiltrageClient $referantFiltrageClient) use ($id){
return $referantFiltrageClient->getId() == $id;
})->first();
}
/**
* @return Collection|ReferantHoraire[]
*/
public function getReferantHoraireCollection(): Collection
{
return $this->referantHoraire;
}
/**
* @param int $id
* @param int $jourTypeId
* @param bool $special
* @return bool
*/
public function hasReferantHoraireByIdJourTypeSpecial(int $id,int $jourTypeId,bool $special): bool
{
return $this->getReferantHoraireCollection()->filter(function (ReferantHoraire $referantHoraire) use ($id,$jourTypeId,$special){
return $referantHoraire->getId() == $id && $referantHoraire->getJourType()->getId() == $jourTypeId && $referantHoraire->getSpecial() == $special;
})->count() == 1;
}
/**
* @param int $id
* @param int $jourTypeId
* @param bool $special
* @return ReferantHoraire
*/
public function getReferantHoraireByIdJourTypeSpecial(int $id,int $jourTypeId,bool $special): ReferantHoraire
{
return $this->getReferantHoraireCollection()->filter(function (ReferantHoraire $referantHoraire) use ($id,$jourTypeId,$special){
return $referantHoraire->getId() == $id && $referantHoraire->getJourType()->getId() == $jourTypeId && $referantHoraire->getSpecial() == $special;
})->first();
}
/**
* @return Collection|ReferantTelephone[]
*/
public function getReferantTelephoneCollection(): Collection
{
return $this->referantTelephone;
}
/**
* @param int $id
* @return bool
*/
public function hasReferantTelephoneById(int $id): bool
{
return $this->getReferantTelephoneCollection()->filter(function (ReferantTelephone $referantTelephone) use ($id){
return $referantTelephone->getId() == $id;
})->count() == 1;
}
/**
* @param int $id
* @return ReferantTelephone
* @throws \Exception
*/
public function getReferantTelephoneById(int $id): ReferantTelephone
{
return $this->getReferantTelephoneCollection()->filter(function (ReferantTelephone $referantTelephone) use ($id){
return $referantTelephone->getId() == $id;
})->first();
}
/**
* @ORM\PrePersist
*/
public function setCreatedAtValue()
{
$this->dateCreation = new \DateTimeImmutable();
}
}