<?php
declare(strict_types=1);

namespace App\Entity\AccessWish;

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

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

    #[ORM\OneToMany(mappedBy: 'accessFamilyWish', targetEntity: AccessWish::class, cascade: ['remove'])]
    private Collection $accessWishes;

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

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

    /**
     * @return Collection<int, AccessWish>
     */
    public function getAccessWishes(): Collection
    {
        return $this->accessWishes;
    }

    public function addAccessWish(AccessWish $accessWish): self
    {
        if (!$this->accessWishes->contains($accessWish)) {
            $this->accessWishes[] = $accessWish;
            $accessWish->setAccessFamilyWish($this);
        }

        return $this;
    }

    public function removeAccessWish(AccessWish $accessWish): self
    {
        if ($this->accessWishes->removeElement($accessWish)) {
            // set the owning side to null (unless already changed)
            if ($accessWish->getAccessFamilyWish() === $this) {
                $accessWish->setAccessFamilyWish(null);
            }
        }

        return $this;
    }

}