<?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;
    }
}
