<?phpnamespace App\Entity;use App\Repository\Criteria2ItemRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;/** * @ORM\Entity(repositoryClass=Criteria2ItemRepository::class) */class Criteria2Item{ /** * @ORM\Id * @ORM\GeneratedValue * @ORM\Column(type="integer") */ private $id; /** * @ORM\Column(type="string", length=255) */ private $label; /** * @ORM\Column(type="string", length=255) */ private $code; /** * @ORM\ManyToOne(targetEntity=Criteria2::class, inversedBy="criteria2Items") * @ORM\JoinColumn(nullable=false) */ private $criteria2; /** * @ORM\ManyToMany(targetEntity=BlogPostCategory::class, mappedBy="criteria1Items") */ private $blogPostCategories; /** * @ORM\ManyToMany(targetEntity=Instance::class, mappedBy="criteria2Items") */ private Collection $instances; public function __construct() { $this->blogPostCategories = new ArrayCollection(); $this->instances = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function getLabel(): ?string { return $this->label; } public function setLabel(string $label): self { $this->label = $label; return $this; } public function getCode(): ?string { return $this->code; } public function setCode(string $code): self { $this->code = $code; return $this; } public function getCriteria2(): ?Criteria2 { return $this->criteria2; } public function setCriteria2(?Criteria2 $criteria2): self { $this->criteria2 = $criteria2; return $this; } /** * @return Collection<int, BlogPostCategory> */ public function getBlogPostCategories(): Collection { return $this->blogPostCategories; } /** * @return Collection<int, Instance> */ public function getInstances(): Collection { return $this->instances; } public function addInstance(Instance $instance): self { if (!$this->instances->contains($instance)) { $this->instances[] = $instance; $instance->addCriteria2Item($this); } return $this; } public function removeInstance(Instance $instance): self { if ($this->instances->removeElement($instance)) { $instance->removeCriteria2Item($this); } return $this; } public function __toString(): string { return $this->getLabel(); }}