src/Entity/Malus.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\MalusRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\DBAL\Types\Types;
  7. use Doctrine\ORM\Mapping as ORM;
  8. #[ORM\Entity(repositoryClassMalusRepository::class)]
  9. class Malus
  10. {
  11.     #[ORM\Id]
  12.     #[ORM\GeneratedValue]
  13.     #[ORM\Column]
  14.     private ?int $id null;
  15.     #[ORM\Column(length255)]
  16.     private ?string $name null;
  17.     #[ORM\Column(length255)]
  18.     private ?string $name_en null;
  19.     #[ORM\Column(typeTypes::TEXT)]
  20.     private ?string $description null;
  21.     #[ORM\Column(typeTypes::TEXT)]
  22.     private ?string $description_en null;
  23.     #[ORM\Column(length255)]
  24.     private ?string $label null;
  25.     #[ORM\Column(length255)]
  26.     private ?string $label_en null;
  27.     #[ORM\Column(length255nullabletrue)]
  28.     private ?string $unit_value null;
  29.     #[ORM\OneToMany(mappedBy'malus'targetEntityMalusList::class, orphanRemovaltrue)]
  30.     private Collection $malusLists;
  31.     #[ORM\OneToMany(mappedBy'malus'targetEntityCriterion::class)]
  32.     private Collection $criteria;
  33.     public function __construct()
  34.     {
  35.         $this->malusLists = new ArrayCollection();
  36.         $this->criteria = new ArrayCollection();
  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.     public function getNameEn(): ?string
  52.     {
  53.         return $this->name_en;
  54.     }
  55.     public function setNameEn(string $name_en): self
  56.     {
  57.         $this->name_en $name_en;
  58.         return $this;
  59.     }
  60.     public function getDescription(): ?string
  61.     {
  62.         return $this->description;
  63.     }
  64.     public function setDescription(string $description): self
  65.     {
  66.         $this->description $description;
  67.         return $this;
  68.     }
  69.     public function getDescriptionEn(): ?string
  70.     {
  71.         return $this->description_en;
  72.     }
  73.     public function setDescriptionEn(string $description_en): self
  74.     {
  75.         $this->description_en $description_en;
  76.         return $this;
  77.     }
  78.     public function getLabel(): ?string
  79.     {
  80.         return $this->label;
  81.     }
  82.     public function setLabel(string $label): self
  83.     {
  84.         $this->label $label;
  85.         return $this;
  86.     }
  87.     public function getLabelEn(): ?string
  88.     {
  89.         return $this->label_en;
  90.     }
  91.     public function setLabelEn(string $label_en): self
  92.     {
  93.         $this->label_en $label_en;
  94.         return $this;
  95.     }
  96.     public function getUnitValue(): ?string
  97.     {
  98.         return $this->unit_value;
  99.     }
  100.     public function setUnitValue(?string $unit_value): self
  101.     {
  102.         $this->unit_value $unit_value;
  103.         return $this;
  104.     }
  105.     /**
  106.      * @return Collection<int, MalusList>
  107.      */
  108.     public function getMalusLists(): Collection
  109.     {
  110.         return $this->malusLists;
  111.     }
  112.     public function addMalusList(MalusList $malusList): self
  113.     {
  114.         if (!$this->malusLists->contains($malusList)) {
  115.             $this->malusLists->add($malusList);
  116.             $malusList->setMalus($this);
  117.         }
  118.         return $this;
  119.     }
  120.     public function removeMalusList(MalusList $malusList): self
  121.     {
  122.         if ($this->malusLists->removeElement($malusList)) {
  123.             // set the owning side to null (unless already changed)
  124.             if ($malusList->getMalus() === $this) {
  125.                 $malusList->setMalus(null);
  126.             }
  127.         }
  128.         return $this;
  129.     }
  130.     /**
  131.      * @return Collection<int, Criterion>
  132.      */
  133.     public function getCriteria(): Collection
  134.     {
  135.         return $this->criteria;
  136.     }
  137.     public function addCriterion(Criterion $criterion): self
  138.     {
  139.         if (!$this->criteria->contains($criterion)) {
  140.             $this->criteria->add($criterion);
  141.             $criterion->setMalus($this);
  142.         }
  143.         return $this;
  144.     }
  145.     public function removeCriterion(Criterion $criterion): self
  146.     {
  147.         if ($this->criteria->removeElement($criterion)) {
  148.             // set the owning side to null (unless already changed)
  149.             if ($criterion->getMalus() === $this) {
  150.                 $criterion->setMalus(null);
  151.             }
  152.         }
  153.         return $this;
  154.     }
  155. }