<?php
declare(strict_types=1);

namespace App\Entity\Billing;

use App\Entity\Booking\EducationalProject;
//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 EducationalProjectIntangible extends AbstractBillingIntangible
{
    #[ORM\Id]
    #[ORM\Column]
    #[ORM\GeneratedValue]
    protected ?int $id = null;

    #[ORM\ManyToOne(inversedBy: 'educationalProjectIntangibles')]
    private EducationalProject $educationalProject;

    #[ORM\OneToMany(mappedBy: 'educationalProjectIntangible', targetEntity: BillingIntangibleExcludeDate::class,  cascade: ['persist'], orphanRemoval: true)]
    private Collection $billingIntangibleExcludeDates;

    public function __construct()
    {
        $this->billingIntangibleExcludeDates = new ArrayCollection();
    }

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

    public function getEducationalProject(): ?EducationalProject
    {
        return $this->educationalProject;
    }

    public function setEducationalProject(?EducationalProject $educationalProject): self
    {
        $this->educationalProject = $educationalProject;

        return $this;
    }

    /**
     * @return Collection<int, BillingIntangibleExcludeDate>
     */
    public function getBillingIntangibleExcludeDates(): Collection
    {
        return $this->billingIntangibleExcludeDates;
    }

    public function addBillingIntangibleExcludeDate(BillingIntangibleExcludeDate $billingIntangibleExcludeDate): self
    {
        if (!$this->billingIntangibleExcludeDates->contains($billingIntangibleExcludeDate)) {
            $this->billingIntangibleExcludeDates[] = $billingIntangibleExcludeDate;
            $billingIntangibleExcludeDate->setEducationalProjectIntangible($this);
        }

        return $this;
    }

    public function removeBillingIntangibleExcludeDate(BillingIntangibleExcludeDate $billingIntangibleExcludeDate): self
    {
        if ($this->billingIntangibleExcludeDates->removeElement($billingIntangibleExcludeDate)) {
            // set the owning side to null (unless already changed)
            if ($billingIntangibleExcludeDate->getEducationalProjectIntangible() === $this) {
                $billingIntangibleExcludeDate->setEducationalProjectIntangible(null);
            }
        }

        return $this;
    }
}
