<?phpnamespace App\Entity;use Doctrine\ORM\Mapping as ORM;use Symfony\Component\Validator\Constraints as Assert;use ApiPlatform\Core\Annotation\ApiResource;use Symfony\Component\Serializer\Annotation\Groups;use App\Entity\Intervention;use App\Entity\User;use App\Entity\Docteur;use App\Repository\DisponibiliteRepository;/** * * Represente le planning des médécins probablement. * @ORM\Table() * @ORM\Entity(repositoryClass=DisponibiliteRepository::class) * */class Disponibilite{ /** * @var integer $id * * @ORM\Id * @ORM\Column(type="integer") * @ORM\GeneratedValue(strategy="AUTO") * * @Groups({"read"}) */ private $id; /** * @var \DateTime * * @ORM\Column(type="datetime") * @Assert\NotBlank() * @Groups({"read"}) */ private $dateStart; /** * @var \DateTime * * @ORM\Column(type="datetime") * @Assert\NotBlank() * @Groups({"read"}) */ private $dateEnd; /** * @var \DateTime * * @ORM\Column(type="boolean") * @Groups({"read"}) */ private $allDay = false; /** * Le médecin qui accepte * @var Docteur * * @ORM\ManyToOne(targetEntity=Docteur::class, inversedBy="disponibilites") * @ORM\JoinColumn(name="docteur_id", referencedColumnName="id", onDelete="SET NULL") */ private $docteur; public function __construct() { $this->dateStart = new \DateTime(); $this->dateEnd = new \DateTime(); } /** * @return int */ public function getId() { return $this->id; } /** * @param int $id */ public function setId($id) { $this->id = $id; } /** * @return \DateTime */ public function getDateStart() { return $this->dateStart; } /** * @param \DateTime $dateStart */ public function setDateStart($dateStart) { $this->dateStart = $dateStart; } /** * @return \DateTime */ public function getDateEnd() { return $this->dateEnd; } /** * @param \DateTime $dateEnd */ public function setDateEnd($dateEnd) { $this->dateEnd = $dateEnd; } /** * @return \DateTime */ public function getAllDay() { return $this->allDay; } /** * @param boolean $allDay */ public function setAllDay($allDay) { $this->allDay = $allDay; } /** * @return Docteur */ public function getDocteur() { return $this->docteur; } /** * @param User $docteur */ public function setDocteur($docteur) { $this->docteur = $docteur; }}