<?php

namespace AppBundle\Entity\Booking;

use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;
use Dunglas\ApiBundle\Annotation\Iri;
use Symfony\Component\Serializer\Annotation\Groups;
use Symfony\Component\Validator\Constraints as Assert;

/**
 * Périodes de vacances d'une Organization
 *
 * @Iri("http://schema.org/OrganizationHoliday")
 */
#[ORM\Entity]
class OrganizationHoliday extends AbstractBooking
{
    /**
     * @var ArrayCollection<OrganizationHolidayRecur>
     */
    #[Assert\Valid]
    #[ORM\OneToMany(targetEntity: 'OrganizationHolidayRecur', mappedBy: 'event', cascade: ['persist'], orphanRemoval: true)]
    #[Groups(['organizationholiday_bookingrecur'])]
    protected $eventRecur;
    public function __construct()
    {
        parent::__construct();
        $this->eventRecur = new ArrayCollection();
    }
}
