<?phpnamespace App\Entity;use App\Repository\Criteria1Repository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;/** * @ORM\Entity(repositoryClass=Criteria1Repository::class) */class Criteria1{ /** * @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=Criteria1Item::class, mappedBy="criteria1", orphanRemoval=true, cascade={"persist"}) */ private $criteria1Items; #[ORM\ManyToMany(targetEntity: Instance::class, mappedBy: 'criteria1')] private Collection $instances; public function __construct() { $this->criteria1Items = 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, Criteria1Item> */ public function getCriteria1Items(): Collection { return $this->criteria1Items; } public function addCriteria1Item(Criteria1Item $criteria1Item): self { if (!$this->criteria1Items->contains($criteria1Item)) { $this->criteria1Items[] = $criteria1Item; $criteria1Item->setCriteria1($this); } return $this; } public function removeCriteria1Item(Criteria1Item $criteria1Item): self { if ($this->criteria1Items->removeElement($criteria1Item)) { // set the owning side to null (unless already changed) if ($criteria1Item->getCriteria1() === $this) { $criteria1Item->setCriteria1(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(); }}