<?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;/** * * Represente le planning des médécins probablement. * @ORM\Table() * @ORM\Entity() * */class RDV{ /** * @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 $date; /** * @var \DateTime * * @ORM\Column(type="boolean") */ private $accept = false; /** * Le médecin qui accepte * @var User * * @ORM\ManyToOne(targetEntity=User::class) * @ORM\JoinColumn(onDelete="SET NULL") */ private $user; /** * @var Intervention * * @ORM\ManyToOne(targetEntity=Intervention::class) * @ORM\JoinColumn(onDelete="SET NULL") * @Groups({"read"}) */ private $intervention; /** * Constructor of Planning Entity */ public function __construct() { $this->accept = false; $this->duree = 30; $this->date = new \DateTime(); } public function __toString() { return (string) $this->getId(); } /** * Get id * * @return integer */ public function getId() { return $this->id; } /** * Get duree * * @return string */ public function getDuree() { return $this->duree; } /** * Set duree * * @param string duree * * @return RDV */ public function setDuree($duree) { $this->duree = $duree; return $this; } /** * Set dateInfo * * @param \DateTime $dateInfo * @return RDV */ public function setDate($dateInfo) { $this->date = $dateInfo; return $this; } /** * Get dateInfo * * @return \DateTime */ public function getDate() { return $this->date; } /** * Get getDateInfoString * * @return string * @Groups({"read"}) */ public function getDateString() { return $this->date->format('Y-m-d'); } /** * @return Intervention */ public function getIntervention() { return $this->intervention; } /** * @param Intervention $intervention */ public function setIntervention($intervention) { $this->intervention = $intervention; } /** * @return \DateTime */ public function getAccept() { return $this->accept; } /** * @param boolean $accept */ public function setAccept($accept) { $this->accept = $accept; } /** * @return User */ public function getUser() { return $this->user; } /** * @param User $user */ public function setUser($user) { $this->user = $user; }}