<?php

namespace App\Entity\OnlineRegistration;

use ApiPlatform\Metadata\ApiResource;
use Doctrine\ORM\Mapping as ORM;

/**
 * Période d'ouverture de l'IEL pour une organisation
 */
//#[ApiResource(operations: [])]
//#[ORM\Entity]
class OnlineRegistrationOpeningPeriod
{
    #[ORM\Id]
    #[ORM\Column]
    #[ORM\GeneratedValue]
    private ?int $id = null;

    #[ORM\ManyToOne(inversedBy: 'onlineRegistrationOpeningPeriods')]
    #[ORM\JoinColumn(nullable: false)]
    private ?OnlineRegistrationSettings $onlineRegistrationSettings = null;

    /**
     * TODO: c'est quoi?
     * @var OnlineRegistrationSettings|null
     */
    #[ORM\ManyToOne(inversedBy: 'onlineRegistrationOpeningPeriods')]
    #[ORM\JoinColumn(nullable: false)]
    private ?OnlineRegistrationSettings $onlineRegistrationSettingsNewEnrolments = null;

    /**
     * Date de début de la période d'IEL
     * @var \DateTimeInterface
     */
    #[ORM\Column(type: 'datetime', nullable: false)]
    private \DateTimeInterface $startDate;

    /**
     * Date de fin de la période d'IEL
     * @var \DateTimeInterface
     */
    #[ORM\Column(type: 'datetime', nullable: false)]
    private \DateTimeInterface $endDate;

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

    public function getOnlineRegistrationSettings(): ?OnlineRegistrationSettings
    {
        return $this->onlineRegistrationSettings;
    }

    public function setOnlineRegistrationSettings(?OnlineRegistrationSettings $onlineRegistrationSettings): void
    {
        $this->onlineRegistrationSettings = $onlineRegistrationSettings;
    }

    public function getOnlineRegistrationSettingsNewEnrolments(): ?OnlineRegistrationSettings
    {
        return $this->onlineRegistrationSettingsNewEnrolments;
    }

    public function setOnlineRegistrationSettingsNewEnrolments(?OnlineRegistrationSettings $onlineRegistrationSettingsNewEnrolments): void
    {
        $this->onlineRegistrationSettingsNewEnrolments = $onlineRegistrationSettingsNewEnrolments;
    }

    public function getStartDate(): \DateTimeInterface
    {
        return $this->startDate;
    }

    public function setStartDate(\DateTimeInterface $startDate): void
    {
        $this->startDate = $startDate;
    }

    public function getEndDate(): \DateTimeInterface
    {
        return $this->endDate;
    }

    public function setEndDate(\DateTimeInterface $endDate): void
    {
        $this->endDate = $endDate;
    }
}
