src/Entity/Criteria4.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\Criteria4Repository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=Criteria4Repository::class)
  9.  */
  10. class Criteria4
  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=Criteria4Item::class, mappedBy="criteria4", orphanRemoval=true, cascade={"persist"})
  30.      */
  31.     private $criteria4Items;
  32.     
  33.     #[ORM\ManyToMany(targetEntityInstance::class, mappedBy'criteria4')]
  34.     private Collection $instances;
  35.     
  36.     public function __construct()
  37.     {
  38.         $this->criteria4Items = 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, Criteria4Item>
  57.      */
  58.     public function getCriteria4Items(): Collection
  59.     {
  60.         return $this->criteria4Items;
  61.     }
  62.     public function addCriteria4Item(Criteria4Item $criteria4Item): self
  63.     {
  64.         if (!$this->criteria4Items->contains($criteria4Item)) {
  65.             $this->criteria4Items[] = $criteria4Item;
  66.             $criteria4Item->setCriteria4($this);
  67.         }
  68.         return $this;
  69.     }
  70.     public function removeCriteria4Item(Criteria4Item $criteria4Item): self
  71.     {
  72.         if ($this->criteria4Items->removeElement($criteria4Item)) {
  73.             // set the owning side to null (unless already changed)
  74.             if ($criteria4Item->getCriteria4() === $this) {
  75.                 $criteria4Item->setCriteria4(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. }