<?phpnamespace App\Entity;use App\Repository\CriterionRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity(repositoryClass: CriterionRepository::class)]class Criterion{ #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column] private ?int $id = null; #[ORM\Column(length: 255)] private ?string $name = null; #[ORM\Column(length: 255)] private ?string $name_en = null; #[ORM\Column] private ?int $note_max = null; #[ORM\ManyToOne(inversedBy: 'criteria')] #[ORM\JoinColumn(nullable: false)] private ?Theme $theme = null; #[ORM\Column] private ?bool $enabled = null; #[ORM\OneToMany(mappedBy: 'criterion', targetEntity: Result::class, orphanRemoval: true)] private Collection $results; #[ORM\ManyToOne(inversedBy: 'criteria')] private ?Malus $malus = null; #[ORM\Column(nullable: true)] private ?int $sort = null; #[ORM\ManyToOne(inversedBy: 'criteriaNotation')] private ?Theme $themeNotation = null; #[ORM\OneToOne(inversedBy: 'criterion', targetEntity: self::class, cascade: ['persist', 'remove'])] private ?self $link = null; #[ORM\OneToOne(mappedBy: 'link', targetEntity: self::class, cascade: ['persist', 'remove'])] private ?self $criterion = null; #[ORM\Column] private ?bool $bonus = null; #[ORM\Column] private ?bool $disppre = null; #[ORM\Column] private ?bool $malus_bonus = null; public function __construct() { $this->results = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function getName(): ?string { return $this->name; } public function setName(string $name): self { $this->name = $name; return $this; } public function getNameEn(): ?string { return $this->name_en; } public function setNameEn(string $name_en): self { $this->name_en = $name_en; return $this; } public function getNoteMax(): ?int { return $this->note_max; } public function setNoteMax(int $note_max): self { $this->note_max = $note_max; return $this; } public function getTheme(): ?Theme { return $this->theme; } public function setTheme(?Theme $theme): self { $this->theme = $theme; return $this; } public function isEnabled(): ?bool { return $this->enabled; } public function setEnabled(bool $enabled): self { $this->enabled = $enabled; return $this; } /** * @return Collection<int, Result> */ public function getResults(): Collection { return $this->results; } public function addResult(Result $result): self { if (!$this->results->contains($result)) { $this->results->add($result); $result->setCriterion($this); } return $this; } public function removeResult(Result $result): self { if ($this->results->removeElement($result)) { // set the owning side to null (unless already changed) if ($result->getCriterion() === $this) { $result->setCriterion(null); } } return $this; } public function getMalus(): ?Malus { return $this->malus; } public function setMalus(?Malus $malus): self { $this->malus = $malus; return $this; } public function getSort(): ?int { return $this->sort; } public function setSort(?int $sort): self { $this->sort = $sort; return $this; } public function getThemeNotation(): ?Theme { return $this->themeNotation; } public function setThemeNotation(?Theme $themeNotation): self { $this->themeNotation = $themeNotation; return $this; } public function getLink(): ?self { return $this->link; } public function setLink(?self $link): self { $this->link = $link; return $this; } public function getCriterion(): ?self { return $this->criterion; } public function setCriterion(?self $criterion): self { // unset the owning side of the relation if necessary if ($criterion === null && $this->criterion !== null) { $this->criterion->setLink(null); } // set the owning side of the relation if necessary if ($criterion !== null && $criterion->getLink() !== $this) { $criterion->setLink($this); } $this->criterion = $criterion; return $this; } public function isBonus(): ?bool { return $this->bonus; } public function setBonus(bool $bonus): self { $this->bonus = $bonus; return $this; } public function isDisppre(): ?bool { return $this->disppre; } public function setDisppre(bool $disppre): self { $this->disppre = $disppre; return $this; } public function isMalusBonus(): ?bool { return $this->malus_bonus; } public function setMalusBonus(bool $malus_bonus): self { $this->malus_bonus = $malus_bonus; return $this; }}