src/Entity/Criteria2.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\Criteria2Repository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=Criteria2Repository::class)
  9.  */
  10. class   Criteria2
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\GeneratedValue
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\Column(type="string", length=255)
  20.      */
  21.     private $name;
  22.     /**
  23.      * @ORM\OneToMany(targetEntity=Criteria2Item::class, mappedBy="criteria2", orphanRemoval=true, cascade={"persist"})
  24.      */
  25.     private $criteria2Items;
  26.     public function __construct()
  27.     {
  28.         $this->criteria2Items = new ArrayCollection();
  29.     }
  30.     public function getId(): ?int
  31.     {
  32.         return $this->id;
  33.     }
  34.     public function getName(): ?string
  35.     {
  36.         return $this->name;
  37.     }
  38.     public function setName(string $name): self
  39.     {
  40.         $this->name $name;
  41.         return $this;
  42.     }
  43.     /**
  44.      * @return Collection<int, Criteria2Item>
  45.      */
  46.     public function getCriteria2Items(): Collection
  47.     {
  48.         return $this->criteria2Items;
  49.     }
  50.     public function addCriteria2Item(Criteria2Item $criteria2Item): self
  51.     {
  52.         if (!$this->criteria2Items->contains($criteria2Item)) {
  53.             $this->criteria2Items[] = $criteria2Item;
  54.             $criteria2Item->setCriteria2($this);
  55.         }
  56.         return $this;
  57.     }
  58.     public function removeCriteria2Item(Criteria2Item $criteria2Item): self
  59.     {
  60.         if ($this->criteria2Items->removeElement($criteria2Item)) {
  61.             // set the owning side to null (unless already changed)
  62.             if ($criteria2Item->getCriteria2() === $this) {
  63.                 $criteria2Item->setCriteria2(null);
  64.             }
  65.         }
  66.         return $this;
  67.     }
  68. }