src/Entity/Criteria5.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\Criteria5Repository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=Criteria5Repository::class)
  9.  */
  10. class Criteria5
  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.     /**
  24.      * @ORM\Column(type="boolean")
  25.      */
  26.     private $isActive true;
  27.     
  28.     /**
  29.      * @ORM\OneToMany(targetEntity=Criteria5Item::class, mappedBy="criteria5", orphanRemoval=true, cascade={"persist"})
  30.      */
  31.     private $criteria5Items;
  32.     
  33.     #[ORM\ManyToMany(targetEntityInstance::class, mappedBy'criteria5')]
  34.     private Collection $instances;
  35.     
  36.     public function __construct()
  37.     {
  38.         $this->criteria5Items = new ArrayCollection();
  39.         $this->instances = new ArrayCollection();
  40.     }
  41.     
  42.     public function getId(): ?int
  43.     {
  44.         return $this->id;
  45.     }
  46.     public function getName(): ?string
  47.     {
  48.         return $this->name;
  49.     }
  50.     public function setName(string $name): self
  51.     {
  52.         $this->name $name;
  53.         return $this;
  54.     }
  55.     /**
  56.      * @return Collection<int, Criteria5Item>
  57.      */
  58.     public function getCriteria5Items(): Collection
  59.     {
  60.         return $this->criteria5Items;
  61.     }
  62.     public function addCriteria5Item(Criteria5Item $criteria5Item): self
  63.     {
  64.         if (!$this->criteria5Items->contains($criteria5Item)) {
  65.             $this->criteria5Items[] = $criteria5Item;
  66.             $criteria5Item->setCriteria5($this);
  67.         }
  68.         return $this;
  69.     }
  70.     public function removeCriteria5Item(Criteria5Item $criteria5Item): self
  71.     {
  72.         if ($this->criteria5Items->removeElement($criteria5Item)) {
  73.             // set the owning side to null (unless already changed)
  74.             if ($criteria5Item->getCriteria5() === $this) {
  75.                 $criteria5Item->setCriteria5(null);
  76.             }
  77.         }
  78.         return $this;
  79.     }
  80.     
  81.     public function isActive(): bool
  82.     {
  83.         return $this->isActive;
  84.     }
  85.     public function setIsActive(bool $isActive): self
  86.     {
  87.         $this->isActive $isActive;
  88.         return $this;
  89.     }
  90.     
  91.     public function __toString(): string
  92.     {
  93.         return $this->getName();
  94.     }
  95. }