src/Entity/Disponibilite.php line 20

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use Symfony\Component\Validator\Constraints as Assert;
  5. use ApiPlatform\Core\Annotation\ApiResource;
  6. use Symfony\Component\Serializer\Annotation\Groups;
  7. use App\Entity\Intervention;
  8. use App\Entity\User;
  9. use App\Entity\Docteur;
  10. use App\Repository\DisponibiliteRepository;
  11. /**
  12.  *
  13.  * Represente le planning des médécins probablement.
  14.  * @ORM\Table()
  15.  * @ORM\Entity(repositoryClass=DisponibiliteRepository::class)
  16.  *
  17.  */
  18. class Disponibilite
  19. {
  20.     /**
  21.      * @var integer $id
  22.      *
  23.      * @ORM\Id
  24.      * @ORM\Column(type="integer")
  25.      * @ORM\GeneratedValue(strategy="AUTO")
  26.      *
  27.      * @Groups({"read"})
  28.      */
  29.     private $id;
  30.     /**
  31.      * @var \DateTime
  32.      *
  33.      * @ORM\Column(type="datetime")
  34.      * @Assert\NotBlank()
  35.      * @Groups({"read"})
  36.      */
  37.     private $dateStart;
  38.     /**
  39.      * @var \DateTime
  40.      *
  41.      * @ORM\Column(type="datetime")
  42.      * @Assert\NotBlank()
  43.      * @Groups({"read"})
  44.      */
  45.     private $dateEnd;
  46.     /**
  47.      * @var \DateTime
  48.      *
  49.      * @ORM\Column(type="boolean")
  50.      * @Groups({"read"})
  51.      */
  52.     private $allDay false;
  53.     /**
  54.      * Le médecin qui accepte
  55.      * @var Docteur
  56.      *
  57.      * @ORM\ManyToOne(targetEntity=Docteur::class, inversedBy="disponibilites")
  58.      * @ORM\JoinColumn(name="docteur_id", referencedColumnName="id", onDelete="SET NULL")
  59.      */
  60.     private $docteur;
  61.     public function __construct()
  62.     {
  63.         $this->dateStart = new \DateTime();
  64.         $this->dateEnd = new \DateTime();
  65.     }
  66.     /**
  67.      * @return int
  68.      */
  69.     public function getId()
  70.     {
  71.         return $this->id;
  72.     }
  73.     /**
  74.      * @param int $id
  75.      */
  76.     public function setId($id)
  77.     {
  78.         $this->id $id;
  79.     }
  80.     /**
  81.      * @return \DateTime
  82.      */
  83.     public function getDateStart()
  84.     {
  85.         return $this->dateStart;
  86.     }
  87.     /**
  88.      * @param \DateTime $dateStart
  89.      */
  90.     public function setDateStart($dateStart)
  91.     {
  92.         $this->dateStart $dateStart;
  93.     }
  94.     /**
  95.      * @return \DateTime
  96.      */
  97.     public function getDateEnd()
  98.     {
  99.         return $this->dateEnd;
  100.     }
  101.     /**
  102.      * @param \DateTime $dateEnd
  103.      */
  104.     public function setDateEnd($dateEnd)
  105.     {
  106.         $this->dateEnd $dateEnd;
  107.     }
  108.     /**
  109.      * @return \DateTime
  110.      */
  111.     public function getAllDay()
  112.     {
  113.         return $this->allDay;
  114.     }
  115.     /**
  116.      * @param boolean $allDay
  117.      */
  118.     public function setAllDay($allDay)
  119.     {
  120.         $this->allDay $allDay;
  121.     }
  122.     /**
  123.      * @return Docteur
  124.      */
  125.     public function getDocteur()
  126.     {
  127.         return $this->docteur;
  128.     }
  129.     /**
  130.      * @param User $docteur
  131.      */
  132.     public function setDocteur($docteur)
  133.     {
  134.         $this->docteur $docteur;
  135.     }
  136. }