<?php
declare(strict_types=1);

namespace App\Entity\Booking;

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

//#[Auditable]
#[ORM\Entity]
class EducationalProjectPublic
{
    #[ORM\Id]
    #[ORM\Column]
    #[ORM\GeneratedValue]
    private ?int $id = null;

    #[ORM\OneToMany(mappedBy: 'public', targetEntity: EducationalProject::class, )]
    private Collection $educationalProjects;

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

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

    /**
     * @return Collection<int, EducationalProject>
     */
    public function getEducationalProjects(): Collection
    {
        return $this->educationalProjects;
    }

    public function addEducationalProject(EducationalProject $educationalProject): self
    {
        if (!$this->educationalProjects->contains($educationalProject)) {
            $this->educationalProjects[] = $educationalProject;
            $educationalProject->setPublic($this);
        }

        return $this;
    }

    public function removeEducationalProject(EducationalProject $educationalProject): self
    {
        if ($this->educationalProjects->removeElement($educationalProject)) {
            // set the owning side to null (unless already changed)
            if ($educationalProject->getPublic() === $this) {
                $educationalProject->setPublic(null);
            }
        }

        return $this;
    }
}
