<?php
declare(strict_types=1);

namespace App\Entity\Organization;

use App\Entity\Core\File;
//use DH\Auditor\Provider\Doctrine\Auditing\Annotation\Auditable;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;

/**
 * Classe ... qui ...
 */
//#[Auditable]
#[ORM\Entity]
class OnlineRegistrationSettings
{
    #[ORM\Id]
    #[ORM\Column]
    #[ORM\GeneratedValue]
    private ?int $id = null;

    #[ORM\OneToMany(mappedBy: 'onlineRegistrationSettings',targetEntity: OnlineRegistrationOpeningPeriod::class, cascade: ['persist'], orphanRemoval: true)]
    private Collection $openingPeriods;

    #[ORM\OneToMany(mappedBy: 'onlineRegistrationSettings', targetEntity: OnlineRegistrationDocument::class, cascade: ['persist'], orphanRemoval: true)]
    private Collection $documents;

    #[ORM\OneToMany(mappedBy: 'guardiansOnlineRegistrationSettings', targetEntity: OnlineRegistrationDocument::class, cascade: ['persist'], orphanRemoval: true)]
    private Collection $guardiansDocuments;

    #[ORM\OneToMany(mappedBy: 'onlineRegistrationSetting', targetEntity: File::class, orphanRemoval: true)]
    private Collection $introductionFiles;

    #[ORM\OneToMany(mappedBy: 'onlineRegistrationSettingNewEnrolments', targetEntity: File::class,orphanRemoval: true)]
    private Collection $introductionFilesNewEnrolments;

    #[ORM\OneToMany(mappedBy: 'onlineRegistrationSettingsNewEnrolments', targetEntity: OnlineRegistrationOpeningPeriod::class, cascade: ['persist'], orphanRemoval: true)]
    private Collection $openingPeriodsNewEnrolments;

    public function __construct()
    {
        $this->openingPeriods = new ArrayCollection();
        $this->documents = new ArrayCollection();
        $this->guardiansDocuments = new ArrayCollection();
        $this->introductionFiles = new ArrayCollection();
        $this->introductionFilesNewEnrolments = new ArrayCollection();
        $this->openingPeriodsNewEnrolments = new ArrayCollection();
    }

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

    /**
     * @return Collection<int, OnlineRegistrationOpeningPeriod>
     */
    public function getOpeningPeriods(): Collection
    {
        return $this->openingPeriods;
    }

    public function addOpeningPeriod(OnlineRegistrationOpeningPeriod $openingPeriod): self
    {
        if (!$this->openingPeriods->contains($openingPeriod)) {
            $this->openingPeriods[] = $openingPeriod;
            $openingPeriod->setOnlineRegistrationSettings($this);
        }

        return $this;
    }

    public function removeOpeningPeriod(OnlineRegistrationOpeningPeriod $openingPeriod): self
    {
        if ($this->openingPeriods->removeElement($openingPeriod)) {
            // set the owning side to null (unless already changed)
            if ($openingPeriod->getOnlineRegistrationSettings() === $this) {
                $openingPeriod->setOnlineRegistrationSettings(null);
            }
        }

        return $this;
    }

    /**
     * @return Collection<int, OnlineRegistrationDocument>
     */
    public function getDocuments(): Collection
    {
        return $this->documents;
    }

    public function addDocument(OnlineRegistrationDocument $document): self
    {
        if (!$this->documents->contains($document)) {
            $this->documents[] = $document;
            $document->setOnlineRegistrationSettings($this);
        }

        return $this;
    }

    public function removeDocument(OnlineRegistrationDocument $document): self
    {
        if ($this->documents->removeElement($document)) {
            // set the owning side to null (unless already changed)
            if ($document->getOnlineRegistrationSettings() === $this) {
                $document->setOnlineRegistrationSettings(null);
            }
        }

        return $this;
    }

    /**
     * @return Collection<int, OnlineRegistrationDocument>
     */
    public function getGuardiansDocuments(): Collection
    {
        return $this->guardiansDocuments;
    }

    public function addGuardiansDocument(OnlineRegistrationDocument $guardiansDocument): self
    {
        if (!$this->guardiansDocuments->contains($guardiansDocument)) {
            $this->guardiansDocuments[] = $guardiansDocument;
            $guardiansDocument->setGuardiansOnlineRegistrationSettings($this);
        }

        return $this;
    }

    public function removeGuardiansDocument(OnlineRegistrationDocument $guardiansDocument): self
    {
        if ($this->guardiansDocuments->removeElement($guardiansDocument)) {
            // set the owning side to null (unless already changed)
            if ($guardiansDocument->getGuardiansOnlineRegistrationSettings() === $this) {
                $guardiansDocument->setGuardiansOnlineRegistrationSettings(null);
            }
        }

        return $this;
    }

    /**
     * @return Collection<int, File>
     */
    public function getIntroductionFiles(): Collection
    {
        return $this->introductionFiles;
    }

    public function addIntroductionFile(File $introductionFile): self
    {
        if (!$this->introductionFiles->contains($introductionFile)) {
            $this->introductionFiles[] = $introductionFile;
            $introductionFile->setOnlineRegistrationSetting($this);
        }

        return $this;
    }

    public function removeIntroductionFile(File $introductionFile): self
    {
        if ($this->introductionFiles->removeElement($introductionFile)) {
            // set the owning side to null (unless already changed)
            if ($introductionFile->getOnlineRegistrationSetting() === $this) {
                $introductionFile->setOnlineRegistrationSetting(null);
            }
        }

        return $this;
    }

    /**
     * @return Collection<int, File>
     */
    public function getIntroductionFilesNewEnrolments(): Collection
    {
        return $this->introductionFilesNewEnrolments;
    }

    public function addIntroductionFilesNewEnrolment(File $introductionFilesNewEnrolment): self
    {
        if (!$this->introductionFilesNewEnrolments->contains($introductionFilesNewEnrolment)) {
            $this->introductionFilesNewEnrolments[] = $introductionFilesNewEnrolment;
            $introductionFilesNewEnrolment->setOnlineRegistrationSettingNewEnrolments($this);
        }

        return $this;
    }

    public function removeIntroductionFilesNewEnrolment(File $introductionFilesNewEnrolment): self
    {
        if ($this->introductionFilesNewEnrolments->removeElement($introductionFilesNewEnrolment)) {
            // set the owning side to null (unless already changed)
            if ($introductionFilesNewEnrolment->getOnlineRegistrationSettingNewEnrolments() === $this) {
                $introductionFilesNewEnrolment->setOnlineRegistrationSettingNewEnrolments(null);
            }
        }

        return $this;
    }

    /**
     * @return Collection<int, OnlineRegistrationOpeningPeriod>
     */
    public function getOpeningPeriodsNewEnrolments(): Collection
    {
        return $this->openingPeriodsNewEnrolments;
    }

    public function addOpeningPeriodsNewEnrolment(OnlineRegistrationOpeningPeriod $openingPeriodsNewEnrolment): self
    {
        if (!$this->openingPeriodsNewEnrolments->contains($openingPeriodsNewEnrolment)) {
            $this->openingPeriodsNewEnrolments[] = $openingPeriodsNewEnrolment;
            $openingPeriodsNewEnrolment->setOnlineRegistrationSettingsNewEnrolments($this);
        }

        return $this;
    }

    public function removeOpeningPeriodsNewEnrolment(OnlineRegistrationOpeningPeriod $openingPeriodsNewEnrolment): self
    {
        if ($this->openingPeriodsNewEnrolments->removeElement($openingPeriodsNewEnrolment)) {
            // set the owning side to null (unless already changed)
            if ($openingPeriodsNewEnrolment->getOnlineRegistrationSettingsNewEnrolments() === $this) {
                $openingPeriodsNewEnrolment->setOnlineRegistrationSettingsNewEnrolments(null);
            }
        }

        return $this;
    }
}