<?php

namespace AppBundle\Entity\Booking;

use AppBundle\Annotation\DefaultField;
use AppBundle\Entity\AccessAndFunction\Access;
use AppBundle\Entity\Traits\ActivityYearTrait;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation\Groups;
use Symfony\Component\Validator\Constraints as Assert;
use AppBundle\Entity\Traits\TimestampableEntity;
use AppBundle\Entity\Traits\CreatorUpdaterEntity;

#[ORM\Entity(repositoryClass: 'AppBundle\Entity\Booking\Repository\CalendarSynchroRepository')]
class CalendarSynchro
{
    use TimestampableEntity;
    use CreatorUpdaterEntity;
    /**
     * @var int
     */
    #[ORM\Column(type: 'integer')]
    #[ORM\Id]
    #[ORM\GeneratedValue(strategy: 'AUTO')]
    #[Groups(['calendarsynchro'])]
    private $id;
    /**
     * @var Access
     */
    #[ORM\OneToOne(targetEntity: 'AppBundle\Entity\AccessAndFunction\Access', inversedBy: 'calendarSynchro', cascade: ['persist'], fetch: 'EAGER')]
    #[ORM\JoinColumn(nullable: true, onDelete: 'CASCADE')]
    #[Groups(['calendarsynchro'])]
    private $access;
    /**
     * @var string
     */
    #[ORM\Column(type: 'string', nullable: false)]
    #[Groups(['calendarsynchro'])]
    protected $hash;
    /**
     * @var \DateTime
     */
    #[ORM\Column(type: 'datetime', nullable: true)]
    #[Assert\DateTime]
    #[Groups(['calendarsynchro'])]
    private $datetimeStart;
    #[ORM\OneToOne(targetEntity: 'AppBundle\Entity\Core\File', inversedBy: 'calendarSynchro', cascade: ['persist'], fetch: 'EAGER')]
    #[ORM\JoinColumn(nullable: true, onDelete: 'CASCADE')]
    #[Groups(['calendarsynchro'])]
    private $file;
    /**
     * @var array
     *
     *
     */
    #[ORM\Column(type: 'json_array', nullable: true)]
    protected $types;
    /**
     * @var bool
     */
    #[ORM\Column(type: 'boolean', options: ['default' => false])]
    #[Assert\Type(type: 'boolean')]
    #[Assert\NotNull]
    #[Groups(['calendarsynchro'])]
    private $eventsHaveChanged = false;
    public function __construct()
    {
    }
    /**
     * Sets id.
     *
     * @param int $id
     *
     * @return $this
     */
    public function setId($id)
    {
        $this->id = $id;

        return $this;
    }
    /**
     * Get id
     *
     * @return integer
     */
    public function getId()
    {
        return $this->id;
    }
    /**
     * Set datetimeStart
     *
     * @param \DateTime $datetimeStart
     *
     * @return CalendarSynchro
     */
    public function setDatetimeStart($datetimeStart)
    {
        $this->datetimeStart = $datetimeStart;

        return $this;
    }
    /**
     * Get datetimeStart
     *
     * @return \DateTime
     */
    public function getDatetimeStart()
    {
        return $this->datetimeStart;
    }
    /**
     * Set access
     *
     * @param \AppBundle\Entity\AccessAndFunction\Access $access
     *
     * @return CalendarSynchro
     */
    public function setAccess(\AppBundle\Entity\AccessAndFunction\Access $access = null)
    {
        $this->access = $access;

        return $this;
    }
    /**
     * Get access
     *
     * @return \AppBundle\Entity\AccessAndFunction\Access
     */
    public function getAccess()
    {
        return $this->access;
    }
    /**
     * Set hash
     *
     * @param string $hash
     *
     * @return CalendarSynchro
     */
    public function setHash($hash)
    {
        $this->hash = $hash;

        return $this;
    }
    /**
     * Get hash
     *
     * @return string
     */
    public function getHash()
    {
        return $this->hash;
    }
    /**
     * Set file
     *
     * @param \AppBundle\Entity\Core\File $file
     *
     * @return CalendarSynchro
     */
    public function setFile(\AppBundle\Entity\Core\File $file = null)
    {
        $this->file = $file;

        return $this;
    }
    /**
     * Get file
     *
     * @return \AppBundle\Entity\Core\File
     */
    public function getFile()
    {
        return $this->file;
    }
    /**
     * Set eventsHaveChanged
     *
     * @param boolean $eventsHaveChanged
     *
     * @return CalendarSynchro
     */
    public function setEventsHaveChanged($eventsHaveChanged)
    {
        $this->eventsHaveChanged = $eventsHaveChanged;

        return $this;
    }
    /**
     * Get eventsHaveChanged
     *
     * @return boolean
     */
    public function getEventsHaveChanged()
    {
        return $this->eventsHaveChanged;
    }
    /**
     * Set types
     *
     * @param array $types
     *
     * @return CalendarSynchro
     */
    public function setTypes($types)
    {
        $this->types = $types;

        return $this;
    }
    /**
     * Get types
     *
     * @return array
     */
    public function getTypes()
    {
        return $this->types;
    }
}
