<?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;
use ApiPlatform\Core\Annotation\ApiResource;
use Application\Sonata\MediaBundle\Entity\Media;
use App\Entity\User;
use App\Entity\Planningg;
use App\Entity\SpecialiteLaboratoire;
use Symfony\Component\Validator\Constraints as Assert;
use Symfony\Component\Serializer\Annotation\Groups;
/**
* @author <erwan> <erwan@kodiom.com>
*
* @ORM\Table()
* @ORM\Entity(repositoryClass="App\Entity\LaboratoireRepository")
* @ApiResource(
* attributes={
* "pagination_client_items_per_page"=true,
* "filters"={"laboratoire.order", "laboratoire.search", "laboratoire.boolean", "laboratoire.numeric", "laboratoire.date"},
* "force_eager"=false,
* "normalization_context"={"groups"={"read", "user", "media"}},
* "denormalization_context"={"groups"={"read", "user", "media"}}
* }
* )
*/
class Laboratoire
{
/**
* @var integer $id
*
* @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;
/**
* @var text
*
* @ORM\Column(name="complement", type="text", nullable=true)
*
* @Groups({"read"})
*/
private $complement;
/**
* @var text
*
* @ORM\Column(name="codePostal", type="string", length=5)
* @Assert\NotBlank()
* @Assert\Length(
* min = 5,
* max = 5
* )
* @Groups({"read"})
*/
private $codePostal;
/**
* @var ArrayCollection
* @ORM\OneToOne(
* targetEntity="App\Entity\User",
* cascade={"persist", "remove"},
* mappedBy="docteur"
* )
* @Groups({"read"})
*/
private $user;
/**
* @var text
*
* @ORM\Column(name="honoraire", type="text")
*
* @Assert\NotBlank()
* @Groups({"read"})
*/
private $honoraire;
/**
* @var text
*
* @ORM\Column(name="presentation", type="text")
*
* @Assert\NotBlank()
* @Groups({"read"})
*/
private $presentation;
/**
* @var text
*
* @ORM\Column(name="formation", type="text")
*
* @Assert\NotBlank()
* @Groups({"read"})
*/
private $formation;
/**
* @var int
*
* @ORM\Column(name="noteSite", type="integer")
*
* @Assert\NotBlank()
* @Groups({"read"})
*/
private $noteSite;
/**
* @var int
*
* @ORM\Column(name="gainAttente", type="integer")
*
* @Assert\NotBlank()
* @Groups({"read"})
*/
private $gainAttente;
/**
* @var ArrayCollection
*
* @ORM\ManyToOne(targetEntity="App\Entity\SpecialiteLaboratoire")
* @Groups({"read"})
*/
private $specialite;
/**
* @var ArrayCollection
*
* @ORM\ManyToMany(targetEntity="App\Entity\Planning", cascade={"persist"}, orphanRemoval=true)
* @Groups({"read"})
*/
private $planning;
/**
* @var bool
*
* @ORM\Column(type="boolean")
* @Groups({"read"})
*/
private $abonne;
/**
* @var bool
*
* @ORM\Column(name="actif", type="boolean")
* @Groups({"read"})
*/
private $actif;
/**
* Constructor of Laboratoire Entity
*/
public function __construct()
{
$this->noteSite = 5;
$this->gainAttente = 0;
$this->planning = new ArrayCollection();
$this->abonne = true;
$this->actif = true;
}
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 Laboratoire
*/
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 Laboratoire
*/
public function setComplement($complement)
{
$this->complement = $complement;
return $this;
}
/**
* Get codePostal
*
* @return text
*/
public function getCodePostal()
{
return $this->codePostal;
}
/**
* Set codePostal
*
* @param text $codePostal
*
* @return Laboratoire
*/
public function setCodePostal($codePostal)
{
$this->codePostal = $codePostal;
return $this;
}
/**
* Get honoraire
*
* @return text
*/
public function getHonoraire()
{
return $this->honoraire;
}
/**
* Set honoraire
*
* @param text $honoraire
*
* @return Laboratoire
*/
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 Laboratoire
*/
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 Laboratoire
*/
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 Laboratoire
*/
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 Laboratoire
*/
public function setGainAttente($gainAttente)
{
$this->gainAttente = $gainAttente;
return $this;
}
/**
* Get specialite
*
* @return ArrayCollection
*/
public function getSpecialite()
{
return $this->specialite;
}
/**
* Set specialite
*
* @param SpecialiteLaboratoire $specialite
*
* @return Laboratoire
*/
public function setSpecialite(SpecialiteLaboratoire $specialite)
{
$this->specialite = $specialite;
return $this;
}
/**
* Get user
*
* @return ArrayCollection
*/
public function getUser()
{
return $this->user;
}
/**
* Set user
*
* @param User $user
*
* @return Laboratoire
*/
public function setUser(User $user)
{
$this->user = $user;
return $this;
}
/**
* Get planning
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getPlanning()
{
return $this->planning;
}
/**
* Set planning
*
* @param Planning $planning
*
* @return Laboratoire
*/
public function addPlanning(Planning $planning)
{
$this->planning[] = $planning;
return $this;
}
/**
* Set planning
*
* @param Planning $planning
*
* @return Laboratoire
*/
public function removePlanning(Planning $planning)
{
$this->planning->removeElement($planning);
}
/**
* Get abonne
*
* @return boolean
*/
public function getAbonne()
{
return $this->abonne;
}
/**
* Set abonne
*
* @param bool $abonne
*
* @return Laboratoire
*/
public function setAbonne($abonne)
{
$this->abonne = $abonne;
return $this;
}
/**
* Get actif
*
* @return boolean
*/
public function getActif()
{
return $this->actif;
}
/**
* Set actif
*
* @param bool $actif
*
* @return Laboratoire
*/
public function setActif($actif)
{
$this->actif = $actif;
return $this;
}
}