<?php

declare(strict_types=1);

namespace App\Entity\Organization;

// use DH\Auditor\Provider\Doctrine\Auditing\Annotation\Auditable;
use ApiPlatform\Metadata\ApiResource;
use Doctrine\ORM\Mapping as ORM;

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

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

    #[ORM\ManyToOne(inversedBy: 'openingPeriodsNewEnrolments')]
    #[ORM\JoinColumn]
    private ?OnlineRegistrationSettings $onlineRegistrationSettingsNewEnrolments = null;

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

    /**
     * Date de fin de la période d'IEL.
     */
    #[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): self
    {
        $this->onlineRegistrationSettings = $onlineRegistrationSettings;

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }
}
