<?php
declare(strict_types=1);

namespace App\Entity\Education;

//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 EducationNotationCriteriaConfig
{
    #[ORM\Id]
    #[ORM\Column]
    #[ORM\GeneratedValue]
    private ?int $id = null;

    #[ORM\ManyToOne(inversedBy: 'educationNotationCriteriaConfigs')]
    private EducationNotationConfig $educationNotationConfig;
    /**
     * @var CriteriaNotation
     */
    #[ORM\ManyToOne(inversedBy: 'educationNotationCriteriaConfigs')]
    #[ORM\JoinColumn(referencedColumnName: 'id', nullable: false)]
    private CriteriaNotation $criteriaNotation;

    #[ORM\OneToMany(mappedBy: 'criteriaNotationConfig', targetEntity: EducationNotation::class)]
    private Collection $educationNotations;

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

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

    public function getEducationNotationConfig(): ?EducationNotationConfig
    {
        return $this->educationNotationConfig;
    }

    public function setEducationNotationConfig(?EducationNotationConfig $educationNotationConfig): self
    {
        $this->educationNotationConfig = $educationNotationConfig;

        return $this;
    }

    public function getCriteriaNotation(): ?CriteriaNotation
    {
        return $this->criteriaNotation;
    }

    public function setCriteriaNotation(?CriteriaNotation $criteriaNotation): self
    {
        $this->criteriaNotation = $criteriaNotation;

        return $this;
    }

    /**
     * @return Collection<int, EducationNotation>
     */
    public function getEducationNotations(): Collection
    {
        return $this->educationNotations;
    }

    public function addEducationNotation(EducationNotation $educationNotation): self
    {
        if (!$this->educationNotations->contains($educationNotation)) {
            $this->educationNotations[] = $educationNotation;
            $educationNotation->setCriteriaNotationConfig($this);
        }

        return $this;
    }

    public function removeEducationNotation(EducationNotation $educationNotation): self
    {
        if ($this->educationNotations->removeElement($educationNotation)) {
            // set the owning side to null (unless already changed)
            if ($educationNotation->getCriteriaNotationConfig() === $this) {
                $educationNotation->setCriteriaNotationConfig(null);
            }
        }

        return $this;
    }
}