<?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;/** * @author <erwan> <erwan@kodiom.com> * * Represente le planning des médécins probablement. * @ORM\Table() * @ORM\Entity(repositoryClass="App\Entity\PlanningRepository") * @ApiResource() */class Planning{ /** * @var integer $id * * @ORM\Id * @ORM\Column(type="integer") * @ORM\GeneratedValue(strategy="AUTO") * * @Groups({"read"}) */ private $id; /** * @var text * * @ORM\Column(type="integer") * @Assert\NotBlank() * @Groups({"read"}) */ private $duree; /** * @var \DateTime * * @ORM\Column(type="datetime") * @Assert\NotBlank() * @Groups({"read"}) */ private $dateInfo; /** * Constructor of Planning Entity */ public function __construct() { $this->duree = 30; $this->dateInfo = new \DateTime(); } public function __toString() { return ($this->getDuree()) ? 'Duree -> '.$this->getDuree() : 'Unknown'; } /** * 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 Planning */ public function setDuree($duree) { $this->duree = $duree; return $this; } /** * Set dateInfo * * @param \DateTime $dateInfo * @return Planning */ public function setDateInfo($dateInfo) { $this->dateInfo = $dateInfo; return $this; } /** * Get dateInfo * * @return \DateTime */ public function getDateInfo() { return $this->dateInfo; } /** * Get getDateInfoString * * @return \DateTime * @Groups({"read"}) */ public function getDateInfoString() { return $this->dateInfo->format('Y-m-d'); } /** * Get getDateInfoString * * @return \DateTime * @Groups({"read"}) */ public function getDateTimeInfoString() { return $this->dateInfo->format('c'); }}