<?php

declare(strict_types=1);

namespace App\Entity\Booking;

use Doctrine\ORM\Mapping as ORM;

/**
 * Données de récurrence d'un évènement, classe de base des récurrences d'évènements.
 *
 * @see EventRecur, CourseRecur, EducationalProjectRecur, ExamenRecur, OrganizationHolidayRecur, PersonHolidayRecur
 */
#[ORM\Entity]
#[ORM\Table(name: 'BookingRecur')]
#[ORM\InheritanceType('SINGLE_TABLE')]
#[ORM\DiscriminatorColumn(name: 'discr', type: 'string')]
#[ORM\DiscriminatorMap(
    [
        'educationalproject' => EducationalProjectRecur::class,
        'course' => CourseRecur::class,
        'event' => EventRecur::class,
        'examen' => ExamenRecur::class,
        'organizationholiday' => OrganizationHolidayRecur::class,
        'personholiday' => PersonHolidayRecur::class,
    ]
)]
abstract class AbstractBookingRecur
{
    #[ORM\Id]
    #[ORM\Column]
    #[ORM\GeneratedValue]
    protected ?int $id = null;

    public function getId(): ?int
    {
        return $this->id;
    }
}
