src/Entity/Criteria3.php line 13

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