src/Entity/Theme.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ThemeRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassThemeRepository::class)]
  8. class Theme
  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]
  17.     private ?int $sort null;
  18.     #[ORM\OneToMany(mappedBy'theme'targetEntityCriterion::class, orphanRemovaltrue)]
  19.     private Collection $criteria;
  20.     #[ORM\ManyToMany(targetEntityJury::class, mappedBy'theme')]
  21.     private Collection $juries;
  22.     #[ORM\Column]
  23.     private ?bool $enabled null;
  24.     #[ORM\OneToMany(mappedBy'theme'targetEntityComment::class, orphanRemovaltrue)]
  25.     private Collection $comments;
  26.     private ?int $totalMax null;
  27.     #[ORM\OneToMany(mappedBy'themeNotation'targetEntityCriterion::class)]
  28.     private Collection $criteriaNotation;
  29.     #[ORM\Column(length64nullabletrue)]
  30.     private ?string $synthesis null;
  31.     #[ORM\Column(length255)]
  32.     private ?string $code null;
  33.     #[ORM\Column(length255)]
  34.     private ?string $name_en null;
  35.     public function __construct()
  36.     {
  37.         $this->criteria = new ArrayCollection();
  38.         $this->juries = new ArrayCollection();
  39.         $this->comments = new ArrayCollection();
  40.         $this->criteriaNotation = new ArrayCollection();
  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.     public function getNameEn(): ?string
  56.     {
  57.         return $this->name_en;
  58.     }
  59.     public function setNameEn(string $name_en): self
  60.     {
  61.         $this->name_en $name_en;
  62.         return $this;
  63.     }
  64.     public function getCode(): ?string
  65.     {
  66.         return $this->code;
  67.     }
  68.     public function setCode(string $code): self
  69.     {
  70.         $this->code $code;
  71.         return $this;
  72.     }
  73.     public function getSort(): ?int
  74.     {
  75.         return $this->sort;
  76.     }
  77.     public function setSort(int $sort): self
  78.     {
  79.         $this->sort $sort;
  80.         return $this;
  81.     }
  82.     /**
  83.      * @return Collection<int, Criterion>
  84.      */
  85.     public function getCriteria(): Collection
  86.     {
  87.         return $this->criteria;
  88.     }
  89.     public function addCriterion(Criterion $criterion): self
  90.     {
  91.         if (!$this->criteria->contains($criterion)) {
  92.             $this->criteria->add($criterion);
  93.             $criterion->setTheme($this);
  94.         }
  95.         return $this;
  96.     }
  97.     public function removeCriterion(Criterion $criterion): self
  98.     {
  99.         if ($this->criteria->removeElement($criterion)) {
  100.             // set the owning side to null (unless already changed)
  101.             if ($criterion->getTheme() === $this) {
  102.                 $criterion->setTheme(null);
  103.             }
  104.         }
  105.         return $this;
  106.     }
  107.     /**
  108.      * @return Collection<int, Jury>
  109.      */
  110.     public function getJuries(): Collection
  111.     {
  112.         return $this->juries;
  113.     }
  114.     public function addJury(Jury $jury): self
  115.     {
  116.         if (!$this->juries->contains($jury)) {
  117.             $this->juries->add($jury);
  118.             $jury->addTheme($this);
  119.         }
  120.         return $this;
  121.     }
  122.     public function removeJury(Jury $jury): self
  123.     {
  124.         if ($this->juries->removeElement($jury)) {
  125.             $jury->removeTheme($this);
  126.         }
  127.         return $this;
  128.     }
  129.     public function isEnabled(): ?bool
  130.     {
  131.         return $this->enabled;
  132.     }
  133.     public function setEnabled(bool $enabled): self
  134.     {
  135.         $this->enabled $enabled;
  136.         return $this;
  137.     }
  138.     /**
  139.      * @return Collection<int, Comment>
  140.      */
  141.     public function getComments(): Collection
  142.     {
  143.         return $this->comments;
  144.     }
  145.     public function addComment(Comment $comment): self
  146.     {
  147.         if (!$this->comments->contains($comment)) {
  148.             $this->comments->add($comment);
  149.             $comment->setTheme($this);
  150.         }
  151.         return $this;
  152.     }
  153.     public function removeComment(Comment $comment): self
  154.     {
  155.         if ($this->comments->removeElement($comment)) {
  156.             // set the owning side to null (unless already changed)
  157.             if ($comment->getTheme() === $this) {
  158.                 $comment->setTheme(null);
  159.             }
  160.         }
  161.         return $this;
  162.     }
  163.     public function getTotalMax(): ?int
  164.     {
  165.         return $this->totalMax;
  166.     }
  167.     public function setTotalMax(int $totalMax): self
  168.     {
  169.         $this->totalMax $totalMax;
  170.         return $this;
  171.     }
  172.     /**
  173.      * @return Collection<int, Criterion>
  174.      */
  175.     public function getCriteriaNotation(): Collection
  176.     {
  177.         return $this->criteriaNotation;
  178.     }
  179.     public function addCriteriaNotation(Criterion $criteriaNotation): self
  180.     {
  181.         if (!$this->criteriaNotation->contains($criteriaNotation)) {
  182.             $this->criteriaNotation->add($criteriaNotation);
  183.             $criteriaNotation->setThemeNotation($this);
  184.         }
  185.         return $this;
  186.     }
  187.     public function removeCriteriaNotation(Criterion $criteriaNotation): self
  188.     {
  189.         if ($this->criteriaNotation->removeElement($criteriaNotation)) {
  190.             // set the owning side to null (unless already changed)
  191.             if ($criteriaNotation->getThemeNotation() === $this) {
  192.                 $criteriaNotation->setThemeNotation(null);
  193.             }
  194.         }
  195.         return $this;
  196.     }
  197.     public function getSynthesis(): ?string
  198.     {
  199.         return $this->synthesis;
  200.     }
  201.     public function setSynthesis(?string $synthesis): self
  202.     {
  203.         $this->synthesis $synthesis;
  204.         return $this;
  205.     }
  206. }