| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208 |
- <?php
- namespace AppBundle\Entity\Place;
- use Doctrine\ORM\Mapping as ORM;
- use Dunglas\ApiBundle\Annotation\Iri;
- use Symfony\Component\Serializer\Annotation\Groups;
- use Symfony\Component\Validator\Constraints as Assert;
- use AppBundle\Entity\Traits\TimestampableEntity;
- use AppBundle\Entity\Traits\CreatorUpdaterEntity;
- /**
- * Définition des plages d'ouverture d'une Place
- *
- * @Iri("http://schema.org/OpeningHoursSpecification")
- */
- #[ORM\Entity]
- class OpeningHoursSpecification
- {
- use TimestampableEntity;
- use CreatorUpdaterEntity;
- /**
- * @var int
- */
- #[ORM\Column(type: 'integer')]
- #[ORM\Id]
- #[ORM\GeneratedValue(strategy: 'AUTO')]
- #[Groups(['openinghoursspecification'])]
- private $id;
- /**
- * @var \DateTime The closing hour of the place or service on the given day(s) of the week.
- *
- * @Iri("https://schema.org/closes")
- */
- #[ORM\Column(type: 'time', nullable: true)]
- #[Assert\Time]
- #[Groups(['openinghoursspecification'])]
- private $closes;
- /**
- * @var array The day of the week for which these opening hours are valid.
- *
- * @Iri("https://schema.org/dayOfWeek")
- */
- #[ORM\Column(type: 'simple_array', nullable: true)]
- #[Assert\Type(type: 'array')]
- #[Assert\Choice(callback: ['\AppBundle\Enum\Place\DayOfWeekEnum', 'toArray'], multiple: true)]
- #[Groups(['openinghoursspecification'])]
- private $dayOfWeek;
- /**
- * @var \DateTime The opening hour of the place or service on the given day(s) of the week.
- *
- * @Iri("https://schema.org/opens")
- */
- #[ORM\Column(type: 'time', nullable: true)]
- #[Assert\Time]
- #[Groups(['openinghoursspecification'])]
- private $opens;
- /**
- * @var \DateTime The date when the item becomes valid.
- *
- * @Iri("https://schema.org/validFrom")
- */
- #[ORM\Column(type: 'datetime', nullable: true)]
- #[Assert\DateTime]
- #[Groups(['openinghoursspecification'])]
- private $validFrom;
- /**
- * @var \DateTime The end of the validity of offer, price specification, or opening hours data.
- *
- * @Iri("https://schema.org/validThrough")
- */
- #[ORM\Column(type: 'datetime', nullable: true)]
- #[Assert\DateTime]
- #[Groups(['openinghoursspecification'])]
- private $validThrough;
- /**
- * Sets id.
- *
- * @param int $id
- *
- * @return $this
- */
- public function setId($id)
- {
- $this->id = $id;
- return $this;
- }
- /**
- * Gets id.
- *
- * @return int
- */
- public function getId()
- {
- return $this->id;
- }
- /**
- * Sets closes.
- *
- * @param \DateTime $closes
- *
- * @return $this
- */
- public function setCloses(\DateTime $closes = null)
- {
- $this->closes = $closes;
- return $this;
- }
- /**
- * Gets closes.
- *
- * @return \DateTime
- */
- public function getCloses()
- {
- return $this->closes;
- }
- /**
- * Sets dayOfWeek.
- *
- * @param array $dayOfWeek
- *
- * @return $this
- */
- public function setDayOfWeek($dayOfWeek)
- {
- $this->dayOfWeek = $dayOfWeek;
- return $this;
- }
- /**
- * Gets dayOfWeek.
- *
- * @return array
- */
- public function getDayOfWeek()
- {
- return $this->dayOfWeek;
- }
- /**
- * Sets opens.
- *
- * @param \DateTime $opens
- *
- * @return $this
- */
- public function setOpens(\DateTime $opens = null)
- {
- $this->opens = $opens;
- return $this;
- }
- /**
- * Gets opens.
- *
- * @return \DateTime
- */
- public function getOpens()
- {
- return $this->opens;
- }
- /**
- * Sets validFrom.
- *
- * @param \DateTime $validFrom
- *
- * @return $this
- */
- public function setValidFrom(\DateTime $validFrom = null)
- {
- $this->validFrom = $validFrom;
- return $this;
- }
- /**
- * Gets validFrom.
- *
- * @return \DateTime
- */
- public function getValidFrom()
- {
- return $this->validFrom;
- }
- /**
- * Sets validThrough.
- *
- * @param \DateTime $validThrough
- *
- * @return $this
- */
- public function setValidThrough(\DateTime $validThrough = null)
- {
- $this->validThrough = $validThrough;
- return $this;
- }
- /**
- * Gets validThrough.
- *
- * @return \DateTime
- */
- public function getValidThrough()
- {
- return $this->validThrough;
- }
- }
|