<?phpnamespace App\Entity;use App\Repository\Criteria4Repository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;/** * @ORM\Entity(repositoryClass=Criteria4Repository::class) */class Criteria4{ /** * @ORM\Id * @ORM\GeneratedValue * @ORM\Column(type="integer") */ private $id; /** * @ORM\Column(type="string", length=255) */ private $name; /** * @ORM\Column(type="boolean") */ private $isActive = true; /** * @ORM\OneToMany(targetEntity=Criteria4Item::class, mappedBy="criteria4", orphanRemoval=true, cascade={"persist"}) */ private $criteria4Items; #[ORM\ManyToMany(targetEntity: Instance::class, mappedBy: 'criteria4')] private Collection $instances; public function __construct() { $this->criteria4Items = new ArrayCollection(); $this->instances = 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; } /** * @return Collection<int, Criteria4Item> */ public function getCriteria4Items(): Collection { return $this->criteria4Items; } public function addCriteria4Item(Criteria4Item $criteria4Item): self { if (!$this->criteria4Items->contains($criteria4Item)) { $this->criteria4Items[] = $criteria4Item; $criteria4Item->setCriteria4($this); } return $this; } public function removeCriteria4Item(Criteria4Item $criteria4Item): self { if ($this->criteria4Items->removeElement($criteria4Item)) { // set the owning side to null (unless already changed) if ($criteria4Item->getCriteria4() === $this) { $criteria4Item->setCriteria4(null); } } return $this; } public function isActive(): bool { return $this->isActive; } public function setIsActive(bool $isActive): self { $this->isActive = $isActive; return $this; } public function __toString(): string { return $this->getName(); }}