src/Entity/Criterion.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\CriterionRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassCriterionRepository::class)]
  8. class Criterion
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column]
  13.     private ?int $id null;
  14.     #[ORM\Column(length255)]
  15.     private ?string $name null;
  16.     #[ORM\Column(length255)]
  17.     private ?string $name_en null;
  18.     #[ORM\Column]
  19.     private ?int $note_max null;
  20.     #[ORM\ManyToOne(inversedBy'criteria')]
  21.     #[ORM\JoinColumn(nullablefalse)]
  22.     private ?Theme $theme null;
  23.     #[ORM\Column]
  24.     private ?bool $enabled null;
  25.     #[ORM\OneToMany(mappedBy'criterion'targetEntityResult::class, orphanRemovaltrue)]
  26.     private Collection $results;
  27.     #[ORM\ManyToOne(inversedBy'criteria')]
  28.     private ?Malus $malus null;
  29.     #[ORM\Column(nullabletrue)]
  30.     private ?int $sort null;
  31.     #[ORM\ManyToOne(inversedBy'criteriaNotation')]
  32.     private ?Theme $themeNotation null;
  33.     #[ORM\OneToOne(inversedBy'criterion'targetEntityself::class, cascade: ['persist''remove'])]
  34.     private ?self $link null;
  35.     #[ORM\OneToOne(mappedBy'link'targetEntityself::class, cascade: ['persist''remove'])]
  36.     private ?self $criterion null;
  37.     #[ORM\Column]
  38.     private ?bool $bonus null;
  39.     #[ORM\Column]
  40.     private ?bool $disppre null;
  41.     #[ORM\Column]
  42.     private ?bool $malus_bonus null;
  43.     public function __construct()
  44.     {
  45.         $this->results = new ArrayCollection();
  46.     }
  47.     public function getId(): ?int
  48.     {
  49.         return $this->id;
  50.     }
  51.     public function getName(): ?string
  52.     {
  53.         return $this->name;
  54.     }
  55.     public function setName(string $name): self
  56.     {
  57.         $this->name $name;
  58.         return $this;
  59.     }
  60.     public function getNameEn(): ?string
  61.     {
  62.         return $this->name_en;
  63.     }
  64.     public function setNameEn(string $name_en): self
  65.     {
  66.         $this->name_en $name_en;
  67.         return $this;
  68.     }
  69.     public function getNoteMax(): ?int
  70.     {
  71.         return $this->note_max;
  72.     }
  73.     public function setNoteMax(int $note_max): self
  74.     {
  75.         $this->note_max $note_max;
  76.         return $this;
  77.     }
  78.     public function getTheme(): ?Theme
  79.     {
  80.         return $this->theme;
  81.     }
  82.     public function setTheme(?Theme $theme): self
  83.     {
  84.         $this->theme $theme;
  85.         return $this;
  86.     }
  87.     public function isEnabled(): ?bool
  88.     {
  89.         return $this->enabled;
  90.     }
  91.     public function setEnabled(bool $enabled): self
  92.     {
  93.         $this->enabled $enabled;
  94.         return $this;
  95.     }
  96.     /**
  97.      * @return Collection<int, Result>
  98.      */
  99.     public function getResults(): Collection
  100.     {
  101.         return $this->results;
  102.     }
  103.     public function addResult(Result $result): self
  104.     {
  105.         if (!$this->results->contains($result)) {
  106.             $this->results->add($result);
  107.             $result->setCriterion($this);
  108.         }
  109.         return $this;
  110.     }
  111.     public function removeResult(Result $result): self
  112.     {
  113.         if ($this->results->removeElement($result)) {
  114.             // set the owning side to null (unless already changed)
  115.             if ($result->getCriterion() === $this) {
  116.                 $result->setCriterion(null);
  117.             }
  118.         }
  119.         return $this;
  120.     }
  121.     public function getMalus(): ?Malus
  122.     {
  123.         return $this->malus;
  124.     }
  125.     public function setMalus(?Malus $malus): self
  126.     {
  127.         $this->malus $malus;
  128.         return $this;
  129.     }
  130.     public function getSort(): ?int
  131.     {
  132.         return $this->sort;
  133.     }
  134.     public function setSort(?int $sort): self
  135.     {
  136.         $this->sort $sort;
  137.         return $this;
  138.     }
  139.     public function getThemeNotation(): ?Theme
  140.     {
  141.         return $this->themeNotation;
  142.     }
  143.     public function setThemeNotation(?Theme $themeNotation): self
  144.     {
  145.         $this->themeNotation $themeNotation;
  146.         return $this;
  147.     }
  148.     public function getLink(): ?self
  149.     {
  150.         return $this->link;
  151.     }
  152.     public function setLink(?self $link): self
  153.     {
  154.         $this->link $link;
  155.         return $this;
  156.     }
  157.     public function getCriterion(): ?self
  158.     {
  159.         return $this->criterion;
  160.     }
  161.     public function setCriterion(?self $criterion): self
  162.     {
  163.         // unset the owning side of the relation if necessary
  164.         if ($criterion === null && $this->criterion !== null) {
  165.             $this->criterion->setLink(null);
  166.         }
  167.         // set the owning side of the relation if necessary
  168.         if ($criterion !== null && $criterion->getLink() !== $this) {
  169.             $criterion->setLink($this);
  170.         }
  171.         $this->criterion $criterion;
  172.         return $this;
  173.     }
  174.     public function isBonus(): ?bool
  175.     {
  176.         return $this->bonus;
  177.     }
  178.     public function setBonus(bool $bonus): self
  179.     {
  180.         $this->bonus $bonus;
  181.         return $this;
  182.     }
  183.     public function isDisppre(): ?bool
  184.     {
  185.         return $this->disppre;
  186.     }
  187.     public function setDisppre(bool $disppre): self
  188.     {
  189.         $this->disppre $disppre;
  190.         return $this;
  191.     }
  192.     public function isMalusBonus(): ?bool
  193.     {
  194.         return $this->malus_bonus;
  195.     }
  196.     public function setMalusBonus(bool $malus_bonus): self
  197.     {
  198.         $this->malus_bonus $malus_bonus;
  199.         return $this;
  200.     }
  201. }