<?php
namespace App\Entity;
use Doctrine\Common\Collections\Collection;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;
use ApiPlatform\Core\Annotation\ApiResource;
use App\Entity\User;
use App\Entity\Planning;
use App\Entity\SpecialiteDocteur;
use App\Entity\Disponibilite;
use Symfony\Component\Validator\Constraints as Assert;
use Symfony\Component\Serializer\Annotation\Groups;
use Symfony\Component\HttpFoundation\File\File;
use Vich\UploaderBundle\Mapping\Annotation as Vich;
use App\Entity\Media;
use App\Repository\DocteurRepository;
use ApiPlatform\Core\Annotation\ApiFilter;
use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\BooleanFilter;
/**
* @author maxime GASTALDO <maxime.gastaldo@gmail.com>
* @ORM\Table()
* @Vich\Uploadable
* @ORM\Entity(repositoryClass=DocteurRepository::class)
* @ApiResource(
* attributes={
* "pagination_client_items_per_page"=true,
* "filters"={"docteur.order", "docteur.search", "docteur.boolean", "docteur.numeric", "docteur.date"},
* "force_eager"=false,
* "normalization_context"={"groups"={"read", "user", "media"}},
* "denormalization_context"={"groups"={"read", "user", "media"}}
* }
* )
* @ApiFilter(BooleanFilter::class, properties={"actif", "working", "urgence", "abonne", "specialite.urgentiste"})
*/
class Docteur
{
/**
*
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*
* @Groups({"read"})
*/
private $id;
/**
* @var text
*
* @ORM\Column(name="adresse", type="string", length=255)
* @Assert\NotBlank()
* @Groups({"read"})
*/
private $adresse;
/**
*
* @ORM\Column(name="complement", type="text", nullable=true)
*
* @Groups({"read"})
*/
private $complement;
/**
*
* @ORM\Column(name="identifiant", type="string", length=25, nullable=true)
* @Groups({"read"})
*/
private $identifiant;
/**
*
* @ORM\Column(name="siret", type="string", nullable=true)
* @Groups({"read"})
*/
private $siret;
/**
*
* @ORM\Column(name="city", type="string", nullable=true)
* @Groups({"read"})
*/
private $city;
/**
*
* @ORM\Column(name="nom_remplacant", type="string", nullable=true)
* @Groups({"read"})
*/
private $nomRemplacant;
/**
*
* @ORM\Column(name="prenom_remplacant", type="string", nullable=true)
* @Groups({"read"})
*/
private $prenomRemplacant;
/**
*
* @ORM\Column(name="adresse_remplacant", type="string", nullable=true)
* @Groups({"read"})
*/
private $adresseRemplacant;
/**
*
* @ORM\Column(name="code_postal_remplacant", type="string", nullable=true)
* @Assert\Length(
* min = 5,
* max = 5
* )
* @Groups({"read"})
*/
private $codePostalRemplacant;
/**
*
* @ORM\Column(name="ville_remplacant", type="string", nullable=true)
* @Groups({"read"})
*/
private $villeRemplacant;
/**
*
* @ORM\Column(name="rpps_remplacant", type="string", nullable=true)
* @Groups({"read"})
*/
private $rppsRemplacant;
/**
*
* @ORM\Column(name="adeli_remplacant", type="string", nullable=true)
* @Groups({"read"})
*/
private $adeliRemplacant;
/**
*
* @ORM\Column(name="codePostal", type="string", length=5, nullable=true)
* @Assert\Length(
* min = 5,
* max = 5
* )
* @Groups({"read"})
*/
private $codePostal;
/**
*
* @ORM\OneToOne(targetEntity=Media::class)
*/
private $photo;
/**
*
* @ORM\OneToOne(targetEntity=Media::class)
*/
private $identite;
/**
*
* @ORM\OneToOne(targetEntity=Media::class)
*/
private $rib;
/**
*
* @var User
* @ORM\OneToOne(
* targetEntity="App\Entity\User",
* cascade={"persist", "remove"},
* mappedBy="docteur"
* )
* @Groups({"read"})
*/
private $user;
/**
*
* @ORM\Column(name="honoraire", type="text", nullable=true)
*
* @Groups({"read"})
*/
private $honoraire;
/**
*
* @ORM\Column(name="disponibilite", type="json", nullable=true)
*
* @Groups({"read"})
*/
private $disponiblite;
/**
*
* @ORM\Column(name="deletedDisponiblite", type="json", nullable=true)
*
* @Groups({"read"})
*/
private $deletedDisponiblite;
/**
* @var string
*
* @ORM\Column(name="startWork", type="string", nullable=true)
*
* @Groups({"read"})
*/
private $startWork;
/**
* @var string
*
* @ORM\Column(name="endWork", type="string", nullable=true)
*
* @Groups({"read"})
*/
private $endWork;
/**
* @var string
*
* @ORM\Column(name="startPause", type="string", nullable=true)
*
* @Groups({"read"})
*/
private $startPause;
/**
* @var string
*
* @ORM\Column(name="endPause", type="string", nullable=true)
*
* @Groups({"read"})
*/
private $endPause;
/**
*
* @ORM\Column(name="presentation", type="text", nullable=true)
*
* @Groups({"read"})
*/
private $presentation;
/**
* @var string
*
* @ORM\Column(name="formation", type="text", nullable=true)
*
* @Groups({"read"})
*/
private $formation;
/**
* @var int
*
* @ORM\Column(name="noteSite", type="integer", nullable=true)
*
* @Groups({"read"})
*/
private $noteSite;
/**
* @var int
*
* @ORM\Column(name="gainAttente", type="integer", nullable=true)
*
* @Groups({"read"})
*/
private $gainAttente;
/**
* @var int
*
* @ORM\Column(name="commission", type="integer", nullable=true)
*
* @Groups({"read"})
*/
private $commission;
/**
* @deprecated
*
* @ORM\Column(name="urlVisio", type="string", length=255, nullable=true)
* @Groups({"read"})
*/
private $urlVisio;
/**
*
* @ORM\Column(name="urlClientVisio", type="string", length=255, nullable=true)
* @Groups({"read"})
*/
private $urlClientVisio;
/**
*
* @ORM\Column(name="urlDocteurVisio", type="string", length=255, nullable=true)
* @Groups({"read"})
*/
private $urlDocteurVisio;
/**
* @var SpecialiteDocteur
*
* @ORM\ManyToOne(targetEntity=SpecialiteDocteur::class)
* @ORM\JoinColumn(onDelete="SET NULL")
* @Groups({"read"})
*/
private $specialite;
/**
* @var ArrayCollection
*
* @ORM\ManyToMany(targetEntity="App\Entity\Planning", cascade={"persist"}, orphanRemoval=true)
* @Groups({"read"})
*/
private $planning;
/**
* @var float
*
* @ORM\Column(type="string", length=50, nullable=true)
* @Groups({"read"})
*/
private $latitude;
/**
* @var float
*
* @ORM\Column(type="string", length=50, nullable=true)
* @Groups({"read"})
*/
private $longitude;
/**
* @var bool
*
* @ORM\Column(type="boolean", nullable=true)
* @Groups({"read"})
*/
private $working = true;
/**
* @var bool
*
* @ORM\Column(type="boolean", nullable=true)
* @Groups({"read"})
*/
private $abonne;
/**
* @var bool
* FONT DE LA CONSULTATIONS DOMICILE
* @ORM\Column(type="boolean", nullable=true)
* @Groups({"read"})
*/
private $urgence = false;
/**
* @var bool
*
* @ORM\Column(type="boolean", nullable=true)
* @Groups({"read"})
*/
private $visio;
/**
* @var bool
*
* @ORM\Column(type="boolean", nullable=true, options={"default":false})
* @Groups({"read"})
*/
private $activationPlateforme = false;
/**
* @var datetime
*
* @ORM\Column(name="dateInfo", type="date", nullable=true)
*
*/
private $dateInfo;
/**
* @var bool
*
* @ORM\Column(name="actif", type="boolean")
* @Groups({"read"})
*/
private $actif;
/**
* @var bool
*
* @ORM\Column(type="boolean" , options={"default":true})
* @Groups({"read"})
*/
private $emailNotification = false;
/**
* @var string
*
* @ORM\Column(type="string", nullable=true)
*/
private $stripeConnectAccount;
/**
* @ORM\OneToMany(targetEntity=Disponibilite::class, mappedBy="docteur")
*/
private $disponibilites;
/**
* @ORM\Column(type="text", nullable=true)
* @var string
*/
private $signatureBase64;
/**
* @Vich\UploadableField(mapping="docteur_signatures", fileNameProperty="signature")
* @var File
*/
private $signatureFile;
/**
* @var bool
*
* @ORM\Column(type="boolean", nullable=true)
* @Groups({"read"})
*/
private $medecinRemplacant = false;
/**
* @var float
*
* @ORM\Column(type="string", length=50, nullable=true, options={"default":0})
* @Groups({"read"})
*/
private $marge;
/**
* Constructor of Docteur Entity
*/
public function __construct()
{
$this->noteSite = 5;
$this->gainAttente = 0;
$this->commission = 0;
$this->planning = new ArrayCollection();
$this->disponibilites = new ArrayCollection();
$this->working = false;
$this->abonne = true;
$this->urgence = false;
$this->visio = false;
$this->actif = true;
$this->dateInfo = new \DateTime;
}
public function __toString()
{
return ($this->getUser()) ? $this->getUser()->getUsername() : 'Unknown';
}
/**
* Get id
*
* @return integer
*/
public function getId()
{
return $this->id;
}
/**
* Get adresse
*
* @return text
*/
public function getAdresse()
{
return $this->adresse;
}
/**
* Set adresse
*
* @param text $adresse
*
* @return Docteur
*/
public function setAdresse($adresse)
{
$this->adresse = $adresse;
return $this;
}
/**
* Get complement
*
* @return text
*/
public function getComplement()
{
return $this->complement;
}
/**
* Set adresse
*
* @param text $complement
*
* @return Docteur
*/
public function setComplement($complement)
{
$this->complement = $complement;
return $this;
}
/**
* Get identifiant
*
* @return text
*/
public function getIdentifiant()
{
return $this->identifiant;
}
/**
* Set adresse
*
* @param text $identifiant
*
* @return Docteur
*/
public function setIdentifiant($identifiant)
{
$this->identifiant = $identifiant;
return $this;
}
/**
* Get codePostal
*
* @return text
*/
public function getCodePostal()
{
return $this->codePostal;
}
/**
* Set codePostal
*
* @param text $codePostal
*
* @return Docteur
*/
public function setCodePostal($codePostal)
{
$this->codePostal = $codePostal;
return $this;
}
/**
* Get photo
*
* @return ArrayCollection
*/
public function getPhoto()
{
return $this->photo;
}
/**
* Set photo
*
* @param Media $photo
*
* @return Docteur
*/
public function setPhoto($photo)
{
$this->photo = $photo;
return $this;
}
/**
* Get identite
*
* @return ArrayCollection
*/
public function getIdentite()
{
return $this->identite;
}
/**
* Set identite
*
* @param Media $identite
*
* @return Docteur
*/
public function setIdentite($identite)
{
$this->identite = $identite;
return $this;
}
/**
* Get rib
*
* @return ArrayCollection
*/
public function getRib()
{
return $this->rib;
}
/**
* Set rib
*
* @param Media $rib
*
* @return Docteur
*/
public function setRib($rib)
{
$this->rib = $rib;
return $this;
}
/**
* Get honoraire
*
* @return text
*/
public function getHonoraire()
{
return $this->honoraire;
}
/**
* Set honoraire
*
* @param text $honoraire
*
* @return Docteur
*/
public function setHonoraire($honoraire)
{
$this->honoraire = $honoraire;
return $this;
}
/**
* Get presentation
*
* @return text
*/
public function getPresentation()
{
return $this->presentation;
}
/**
* Set presentation
*
* @param text $presentation
*
* @return Docteur
*/
public function setPresentation($presentation)
{
$this->presentation = $presentation;
return $this;
}
/**
* Get formation
*
* @return text
*/
public function getFormation()
{
return $this->formation;
}
/**
* Set formation
*
* @param text $formation
*
* @return Docteur
*/
public function setFormation($formation)
{
$this->formation = $formation;
return $this;
}
/**
* Get noteSite
*
* @return integer
*/
public function getNoteSite()
{
return $this->noteSite;
}
/**
* Set noteSite
*
* @param int $noteSite
*
* @return Docteur
*/
public function setNoteSite($noteSite)
{
$this->noteSite = $noteSite;
return $this;
}
/**
* Get gainAttente
*
* @return integer
*/
public function getGainAttente()
{
return $this->gainAttente;
}
/**
* Set gainAttente
*
* @param int $gainAttente
*
* @return Docteur
*/
public function setGainAttente($gainAttente)
{
$this->gainAttente = $gainAttente;
return $this;
}
/**
* Get commission
*
* @return integer
*/
public function getCommission()
{
return $this->commission;
}
/**
* Set commission
*
* @param int $commission
*
* @return Docteur
*/
public function setCommission($commission)
{
$this->commission = $commission;
return $this;
}
/**
* Get urlVisio
*
* @return integer
*/
public function getUrlVisio()
{
return $this->urlVisio;
}
/**
* Set urlVisio
*
* @param int $urlVisio
*
* @return Docteur
*/
public function setUrlVisio($urlVisio)
{
$this->urlVisio = $urlVisio;
return $this;
}
/**
* Get urlClientVisio
*
* @return string
*/
public function getUrlClientVisio()
{
return $this->urlClientVisio;
}
/**
* Set urlClientVisio
*
* @param int $urlClientVisio
*
* @return Docteur
*/
public function setUrlClientVisio($urlClientVisio)
{
$this->urlClientVisio = $urlClientVisio;
return $this;
}
/**
* Get urlDocteurVisio
*
* @return string
*/
public function getUrlDocteurVisio()
{
return $this->urlDocteurVisio;
}
/**
* Set urlDocteurVisio
*
* @param int $urlDocteurVisio
*
* @return Docteur
*/
public function setUrlDocteurVisio($urlDocteurVisio)
{
$this->urlDocteurVisio = $urlDocteurVisio;
return $this;
}
/**
* Get specialite
*
* @return SpecialiteDocteur
*/
public function getSpecialite()
{
return $this->specialite;
}
/**
* Set specialite
*
* @param SpecialiteDocteur $specialite
*
* @return Docteur
*/
public function setSpecialite($specialite)
{
$this->specialite = $specialite;
return $this;
}
/**
* Get user
*
* @return User
*/
public function getUser()
{
return $this->user;
}
/**
* Set user
*
* @param User $user
*
* @return Docteur
*/
public function setUser(?User $user): self
{
$this->user = $user;
return $this;
}
/**
* Get planning
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getPlanning()
{
return $this->planning;
}
/**
* Set planning
*
* @param Planning $planning
*
* @return Docteur
*/
public function addPlanning($planning)
{
$this->planning[] = $planning;
return $this;
}
/**
* Set planning
*
* @param Planning $planning
*
* @return Docteur
*/
public function removePlanning($planning)
{
$this->planning->removeElement($planning);
}
/**
* Set latitude
*
* @param float $latitude
* @return Magasin
*/
public function setLatitude($latitude)
{
$this->latitude = $latitude;
return $this;
}
/**
* Get latitude
*
* @return string
*/
public function getLatitude()
{
return $this->latitude;
}
/**
* Get latitude
* @Groups({"read"})
*
* @return float
*/
public function getLatitudeVal()
{
$data = str_replace(',','.',$this->latitude);
return floatval($data);
}
/**
* Set longitude
*
* @param float $longitude
* @return Magasin
*/
public function setLongitude($longitude)
{
$this->longitude = $longitude;
return $this;
}
/**
* Get longitude
*
* @return float
*/
public function getLongitude()
{
return $this->longitude;
}
/**
* Get longitude
* @Groups({"read"})
*
* @return string
*/
public function getLongitudeVal()
{
$data = str_replace(',','.',$this->longitude);
return floatval($data);
}
/**
* Get working
*
* @return boolean
*/
public function getWorking()
{
return $this->working;
}
/**
* Set working
*
* @param bool $working
*
* @return Docteur
*/
public function setWorking($working)
{
$this->working = $working;
return $this;
}
/**
* Get abonne
*
* @return boolean
*/
public function getAbonne()
{
return $this->abonne;
}
/**
* Set abonne
*
* @param bool $abonne
*
* @return Docteur
*/
public function setAbonne($abonne)
{
$this->abonne = $abonne;
return $this;
}
/**
* Get urgence
*
* @return boolean
*/
public function getUrgence()
{
return $this->urgence;
}
/**
* Set urgence
*
* @param bool $urgence
*
* @return Docteur
*/
public function setUrgence($urgence)
{
$this->urgence = $urgence;
return $this;
}
/**
* Get visio
*
* @return boolean
*/
public function getVisio()
{
return $this->visio;
}
/**
* Set visio
*
* @param bool $visio
*
* @return Docteur
*/
public function setVisio($visio)
{
$this->visio = $visio;
return $this;
}
/**
* Get dateInfo
*
* @return datetime
*/
public function getDateInfo()
{
return $this->dateInfo;
}
/**
* Set dateInfo
*
* @param datetime $dateInfo
*
* @return Intervention
*/
public function setDateInfo($dateInfo)
{
$this->dateInfo = $dateInfo;
return $this;
}
/**
* Get getDateInfoInfoString
*
* @return \DateTime|null
* @Groups({"read"})
*/
public function getDateInfoInfoString()
{
if ($this->dateInfo !== null) {
return $this->dateInfo->format('Y-m-d');
}
return null;
}
/**
* Get actif
*
* @return boolean
*/
public function getActif()
{
return $this->actif;
}
/**
* Set actif
*
* @param bool $actif
*
* @return Actualite
*/
public function setActif($actif)
{
$this->actif = $actif;
return $this;
}
/**
* @return bool
*/
public function isEmailNotification()
{
return $this->emailNotification;
}
/**
* @param bool $emailNotification
*/
public function setEmailNotification($emailNotification)
{
$this->emailNotification = $emailNotification;
}
/**
* @return string
*/
public function getStripeConnectAccount()
{
return $this->stripeConnectAccount;
}
/**
* @param string $stripeConnectAccount
*/
public function setStripeConnectAccount($stripeConnectAccount)
{
$this->stripeConnectAccount = $stripeConnectAccount;
}
/**
* @return mixed
*/
public function getDisponiblite()
{
return $this->disponiblite;
}
/**
* @param mixed $disponiblite
*/
public function setDisponiblite($disponiblite)
{
$this->disponiblite = $disponiblite;
}
/**
* @return mixed
*/
public function getDeletedDisponiblite()
{
return $this->deletedDisponiblite;
}
/**
* @param mixed $deletedDisponiblite
*/
public function setDeletedDisponiblite($deletedDisponiblite)
{
$this->deletedDisponiblite = $deletedDisponiblite;
}
/**
* @return Disponibilite[]
*/
public function getDisponibilites()
{
return $this->disponibilites;
}
/**
* @param mixed $disponibilites
*/
public function setDisponibilites($disponibilites)
{
$this->disponibilites = $disponibilites;
}
/**
* @return mixed
*/
public function getSiret()
{
return $this->siret;
}
/**
* @param mixed $siret
*/
public function setSiret($siret)
{
$this->siret = $siret;
}
/**
* @return mixed
*/
public function getCity()
{
return $this->city;
}
/**
* @param mixed $city
*/
public function setCity($city)
{
$this->city = $city;
}
/**
* @return File
*/
public function getSignatureFile()
{
return $this->signatureFile;
}
/**
* @param File $signatureFile
*/
public function setSignatureFile($signatureFile)
{
$this->signatureFile = $signatureFile;
}
/**
* @return bool
*/
public function isMedecinRemplacant()
{
return $this->medecinRemplacant;
}
/**
* @param bool $medecinRemplacant
*/
public function setMedecinRemplacant($medecinRemplacant)
{
$this->medecinRemplacant = $medecinRemplacant;
}
/**
* @return mixed
*/
public function getNomRemplacant()
{
return $this->nomRemplacant;
}
/**
* @param mixed $nomRemplacant
*/
public function setNomRemplacant($nomRemplacant)
{
$this->nomRemplacant = $nomRemplacant;
}
/**
* @return mixed
*/
public function getPrenomRemplacant()
{
return $this->prenomRemplacant;
}
/**
* @param mixed $prenomRemplacant
*/
public function setPrenomRemplacant($prenomRemplacant)
{
$this->prenomRemplacant = $prenomRemplacant;
}
/**
* @return mixed
*/
public function getAdresseRemplacant()
{
return $this->adresseRemplacant;
}
/**
* @param mixed $adresseRemplacant
*/
public function setAdresseRemplacant($adresseRemplacant)
{
$this->adresseRemplacant = $adresseRemplacant;
}
/**
* @return mixed
*/
public function getCodePostalRemplacant()
{
return $this->codePostalRemplacant;
}
/**
* @param mixed $codePostalRemplacant
*/
public function setCodePostalRemplacant($codePostalRemplacant)
{
$this->codePostalRemplacant = $codePostalRemplacant;
}
/**
* @return mixed
*/
public function getVilleRemplacant()
{
return $this->villeRemplacant;
}
/**
* @param mixed $villeRemplacant
*/
public function setVilleRemplacant($villeRemplacant)
{
$this->villeRemplacant = $villeRemplacant;
}
/**
* @return mixed
*/
public function getRppsRemplacant()
{
return $this->rppsRemplacant;
}
/**
* @param mixed $rppsRemplacant
*/
public function setRppsRemplacant($rppsRemplacant)
{
$this->rppsRemplacant = $rppsRemplacant;
}
/**
* @return string
*/
public function getSignatureBase64()
{
return $this->signatureBase64;
}
/**
* @param string $signatureBase64
*/
public function setSignatureBase64($signatureBase64)
{
$this->signatureBase64 = $signatureBase64;
}
/**
* @return string
*/
public function getStartWork()
{
return $this->startWork;
}
/**
* @param string $startWork
*/
public function setStartWork($startWork)
{
$this->startWork = $startWork;
}
/**
* @return string
*/
public function getEndWork()
{
return $this->endWork;
}
/**
* @param string $endWork
*/
public function setEndWork($endWork)
{
$this->endWork = $endWork;
}
/**
* @return string
*/
public function getStartPause()
{
return $this->startPause;
}
/**
* @param string $startPause
*/
public function setStartPause($startPause)
{
$this->startPause = $startPause;
}
/**
* @return string
*/
public function getEndPause()
{
return $this->endPause;
}
/**
* @param string $endPause
*/
public function setEndPause($endPause)
{
$this->endPause = $endPause;
}
/**
* @return mixed
*/
public function getAdeliRemplacant()
{
return $this->adeliRemplacant;
}
/**
* @param mixed $adeliRemplacant
*/
public function setAdeliRemplacant($adeliRemplacant)
{
$this->adeliRemplacant = $adeliRemplacant;
}
/**
* Set marge
*
* @param string $marge
* @return mixed
*/
public function setMarge($marge)
{
$this->marge = $marge;
return $this;
}
/**
* Get marge
*
* @return ?float
*/
public function getMarge()
{
return $this->marge;
}
/**
* Get activationPlateforme
*
* @return boolean
*/
public function getActivationPlateforme()
{
return $this->activationPlateforme;
}
/**
* Set activationPlateforme
*
* @param bool $activationPlateforme
*
* @return Docteur
*/
public function setActivationPlateforme($activationPlateforme)
{
$this->activationPlateforme = $activationPlateforme;
return $this;
}
}