<?php
namespace App\Entity;
use App\Repository\Criteria2Repository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=Criteria2Repository::class)
*/
class Criteria2
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
*/
private $name;
/**
* @ORM\OneToMany(targetEntity=Criteria2Item::class, mappedBy="criteria2", orphanRemoval=true, cascade={"persist"})
*/
private $criteria2Items;
public function __construct()
{
$this->criteria2Items = 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, Criteria2Item>
*/
public function getCriteria2Items(): Collection
{
return $this->criteria2Items;
}
public function addCriteria2Item(Criteria2Item $criteria2Item): self
{
if (!$this->criteria2Items->contains($criteria2Item)) {
$this->criteria2Items[] = $criteria2Item;
$criteria2Item->setCriteria2($this);
}
return $this;
}
public function removeCriteria2Item(Criteria2Item $criteria2Item): self
{
if ($this->criteria2Items->removeElement($criteria2Item)) {
// set the owning side to null (unless already changed)
if ($criteria2Item->getCriteria2() === $this) {
$criteria2Item->setCriteria2(null);
}
}
return $this;
}
}