src/Entity/Quarter.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Entity\Traits\Timestampable;
  4. use App\Repository\QuarterRepository;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Collections\Collection;
  7. use Doctrine\ORM\Mapping as ORM;
  8. use JMS\Serializer\Annotation\Groups;
  9. #[ORM\HasLifecycleCallbacks]
  10. #[ORM\Entity(repositoryClassQuarterRepository::class)]
  11. class Quarter
  12. {
  13.     use Timestampable;
  14.     #[ORM\Id]
  15.     #[ORM\GeneratedValue]
  16.     #[ORM\Column]
  17.     #[Groups(['getExamStudent''getStatsStudentParentIndex'])]
  18.     private ?int $id null;
  19.     #[ORM\Column(length255)]
  20.     #[Groups(['getExamStudent''getStatsStudentParentIndex'])]
  21.     private ?string $name null;
  22.     #[ORM\Column(nullabletrue)]
  23.     private ?float $coef null;
  24.     #[ORM\OneToMany(mappedBy'quarter'targetEntityExams::class, orphanRemovaltrue)]
  25.     private Collection $exams;
  26.     #[ORM\ManyToOne(inversedBy'quarters'cascade: ["persist"])]
  27.     #[ORM\JoinColumn(nullablefalse)]
  28.     private ?SchoolYear $year null;
  29.     #[ORM\ManyToOne(inversedBy'quarters'cascade: ["persist"])]
  30.     #[ORM\JoinColumn(nullablefalse)]
  31.     private ?User $author null;
  32.     #[ORM\ManyToOne(inversedBy'quarter')]
  33.     #[ORM\JoinColumn(nullabletrue)]
  34.     private ?GlobalQuarter $globalQuarter null;
  35.     #[ORM\OneToMany(mappedBy'quarter'targetEntityDisciplineBlame::class)]
  36.     private Collection $disciplineBlames;
  37.     #[ORM\OneToMany(mappedBy'quarter'targetEntityDisciplineWarning::class)]
  38.     private Collection $disciplineWarnings;
  39.     #[ORM\OneToMany(mappedBy'quarter'targetEntityDisciplineRetained::class)]
  40.     private Collection $disciplineRetaineds;
  41.     #[ORM\OneToMany(mappedBy'quarter'targetEntityDisciplinePunish::class)]
  42.     private Collection $disciplinePunishes;
  43.     #[ORM\Column(length255)]
  44.     #[Groups(['getExamStudent''getStatsStudentParentIndex'])]
  45.     private ?string $nameEn null;
  46.     #[ORM\Column(length255nullabletrue)]
  47.     #[Groups(['getExamStudent''getStatsStudentParentIndex'])]
  48.     private ?string $slug null;
  49.     #[ORM\OneToMany(mappedBy'quarter'targetEntityDisciplineConcile::class)]
  50.     private Collection $disciplineConciles;
  51.     #[ORM\OneToMany(mappedBy'quarter'targetEntityDisciplineExclusion::class)]
  52.     private Collection $disciplineExclusions;
  53.     #[ORM\ManyToOne(inversedBy'quarter')]
  54.     private ?Agenda $agenda null;
  55.     public function __construct()
  56.     {
  57.         $this->exams = new ArrayCollection();
  58.         $this->disciplineBlames = new ArrayCollection();
  59.         $this->disciplineWarnings = new ArrayCollection();
  60.         $this->disciplineRetaineds = new ArrayCollection();
  61.         $this->disciplinePunishes = new ArrayCollection();
  62.         $this->disciplineConciles = new ArrayCollection();
  63.         $this->disciplineExclusions = new ArrayCollection();
  64.     }
  65.     public function getId(): ?int
  66.     {
  67.         return $this->id;
  68.     }
  69.     public function getName(): ?string
  70.     {
  71.         return $this->name;
  72.     }
  73.     public function setName(string $name): static
  74.     {
  75.         $this->name $name;
  76.         return $this;
  77.     }
  78.     public function getCoef(): ?float
  79.     {
  80.         return $this->coef;
  81.     }
  82.     public function setCoef(?float $coef): static
  83.     {
  84.         $this->coef $coef;
  85.         return $this;
  86.     }
  87.     /**
  88.      * @return Collection<int, Exams>
  89.      */
  90.     public function getExams(): Collection
  91.     {
  92.         return $this->exams;
  93.     }
  94.     public function addExam(Exams $exam): static
  95.     {
  96.         if (!$this->exams->contains($exam)) {
  97.             $this->exams->add($exam);
  98.             $exam->setQuarter($this);
  99.         }
  100.         return $this;
  101.     }
  102.     public function removeExam(Exams $exam): static
  103.     {
  104.         if ($this->exams->removeElement($exam)) {
  105.             // set the owning side to null (unless already changed)
  106.             if ($exam->getQuarter() === $this) {
  107.                 $exam->setQuarter(null);
  108.             }
  109.         }
  110.         return $this;
  111.     }
  112.     public function getYear(): ?SchoolYear
  113.     {
  114.         return $this->year;
  115.     }
  116.     public function setYear(?SchoolYear $year): static
  117.     {
  118.         $this->year $year;
  119.         return $this;
  120.     }
  121.     public function getAuthor(): ?User
  122.     {
  123.         return $this->author;
  124.     }
  125.     public function setAuthor(?User $author): static
  126.     {
  127.         $this->author $author;
  128.         return $this;
  129.     }
  130.     public function getGlobalQuarter(): ?GlobalQuarter
  131.     {
  132.         return $this->globalQuarter;
  133.     }
  134.     public function setGlobalQuarter(?GlobalQuarter $globalQuarter): static
  135.     {
  136.         $this->globalQuarter $globalQuarter;
  137.         return $this;
  138.     }
  139.     /**
  140.      * @return Collection<int, DisciplineBlame>
  141.      */
  142.     public function getDisciplineBlames(): Collection
  143.     {
  144.         return $this->disciplineBlames;
  145.     }
  146.     public function addDisciplineBlame(DisciplineBlame $disciplineBlame): static
  147.     {
  148.         if (!$this->disciplineBlames->contains($disciplineBlame)) {
  149.             $this->disciplineBlames->add($disciplineBlame);
  150.             $disciplineBlame->setQuarter($this);
  151.         }
  152.         return $this;
  153.     }
  154.     public function removeDisciplineBlame(DisciplineBlame $disciplineBlame): static
  155.     {
  156.         if ($this->disciplineBlames->removeElement($disciplineBlame)) {
  157.             // set the owning side to null (unless already changed)
  158.             if ($disciplineBlame->getQuarter() === $this) {
  159.                 $disciplineBlame->setQuarter(null);
  160.             }
  161.         }
  162.         return $this;
  163.     }
  164.     /**
  165.      * @return Collection<int, DisciplineWarning>
  166.      */
  167.     public function getDisciplineWarnings(): Collection
  168.     {
  169.         return $this->disciplineWarnings;
  170.     }
  171.     public function addDisciplineWarning(DisciplineWarning $disciplineWarning): static
  172.     {
  173.         if (!$this->disciplineWarnings->contains($disciplineWarning)) {
  174.             $this->disciplineWarnings->add($disciplineWarning);
  175.             $disciplineWarning->setQuarter($this);
  176.         }
  177.         return $this;
  178.     }
  179.     public function removeDisciplineWarning(DisciplineWarning $disciplineWarning): static
  180.     {
  181.         if ($this->disciplineWarnings->removeElement($disciplineWarning)) {
  182.             // set the owning side to null (unless already changed)
  183.             if ($disciplineWarning->getQuarter() === $this) {
  184.                 $disciplineWarning->setQuarter(null);
  185.             }
  186.         }
  187.         return $this;
  188.     }
  189.     /**
  190.      * @return Collection<int, DisciplineRetained>
  191.      */
  192.     public function getDisciplineRetaineds(): Collection
  193.     {
  194.         return $this->disciplineRetaineds;
  195.     }
  196.     public function addDisciplineRetained(DisciplineRetained $disciplineRetained): static
  197.     {
  198.         if (!$this->disciplineRetaineds->contains($disciplineRetained)) {
  199.             $this->disciplineRetaineds->add($disciplineRetained);
  200.             $disciplineRetained->setQuarter($this);
  201.         }
  202.         return $this;
  203.     }
  204.     public function removeDisciplineRetained(DisciplineRetained $disciplineRetained): static
  205.     {
  206.         if ($this->disciplineRetaineds->removeElement($disciplineRetained)) {
  207.             // set the owning side to null (unless already changed)
  208.             if ($disciplineRetained->getQuarter() === $this) {
  209.                 $disciplineRetained->setQuarter(null);
  210.             }
  211.         }
  212.         return $this;
  213.     }
  214.     /**
  215.      * @return Collection<int, DisciplinePunish>
  216.      */
  217.     public function getDisciplinePunishes(): Collection
  218.     {
  219.         return $this->disciplinePunishes;
  220.     }
  221.     public function addDisciplinePunish(DisciplinePunish $disciplinePunish): static
  222.     {
  223.         if (!$this->disciplinePunishes->contains($disciplinePunish)) {
  224.             $this->disciplinePunishes->add($disciplinePunish);
  225.             $disciplinePunish->setQuarter($this);
  226.         }
  227.         return $this;
  228.     }
  229.     public function removeDisciplinePunish(DisciplinePunish $disciplinePunish): static
  230.     {
  231.         if ($this->disciplinePunishes->removeElement($disciplinePunish)) {
  232.             // set the owning side to null (unless already changed)
  233.             if ($disciplinePunish->getQuarter() === $this) {
  234.                 $disciplinePunish->setQuarter(null);
  235.             }
  236.         }
  237.         return $this;
  238.     }
  239.     public function getNameEn(): ?string
  240.     {
  241.         return $this->nameEn;
  242.     }
  243.     public function setNameEn(string $nameEn): static
  244.     {
  245.         $this->nameEn $nameEn;
  246.         return $this;
  247.     }
  248.     public function getSlug(): ?string
  249.     {
  250.         return $this->slug;
  251.     }
  252.     public function setSlug(?string $slug): static
  253.     {
  254.         $this->slug $slug;
  255.         return $this;
  256.     }
  257.     /**
  258.      * @return Collection<int, DisciplineConcile>
  259.      */
  260.     public function getDisciplineConciles(): Collection
  261.     {
  262.         return $this->disciplineConciles;
  263.     }
  264.     public function addDisciplineConcile(DisciplineConcile $disciplineConcile): static
  265.     {
  266.         if (!$this->disciplineConciles->contains($disciplineConcile)) {
  267.             $this->disciplineConciles->add($disciplineConcile);
  268.             $disciplineConcile->setQuarter($this);
  269.         }
  270.         return $this;
  271.     }
  272.     public function removeDisciplineConcile(DisciplineConcile $disciplineConcile): static
  273.     {
  274.         if ($this->disciplineConciles->removeElement($disciplineConcile)) {
  275.             // set the owning side to null (unless already changed)
  276.             if ($disciplineConcile->getQuarter() === $this) {
  277.                 $disciplineConcile->setQuarter(null);
  278.             }
  279.         }
  280.         return $this;
  281.     }
  282.     /**
  283.      * @return Collection<int, DisciplineExclusion>
  284.      */
  285.     public function getDisciplineExclusions(): Collection
  286.     {
  287.         return $this->disciplineExclusions;
  288.     }
  289.     public function addDisciplineExclusion(DisciplineExclusion $disciplineExclusion): static
  290.     {
  291.         if (!$this->disciplineExclusions->contains($disciplineExclusion)) {
  292.             $this->disciplineExclusions->add($disciplineExclusion);
  293.             $disciplineExclusion->setQuarter($this);
  294.         }
  295.         return $this;
  296.     }
  297.     public function removeDisciplineExclusion(DisciplineExclusion $disciplineExclusion): static
  298.     {
  299.         if ($this->disciplineExclusions->removeElement($disciplineExclusion)) {
  300.             // set the owning side to null (unless already changed)
  301.             if ($disciplineExclusion->getQuarter() === $this) {
  302.                 $disciplineExclusion->setQuarter(null);
  303.             }
  304.         }
  305.         return $this;
  306.     }
  307.     public function getAgenda(): ?Agenda
  308.     {
  309.         return $this->agenda;
  310.     }
  311.     public function setAgenda(?Agenda $agenda): static
  312.     {
  313.         $this->agenda $agenda;
  314.         return $this;
  315.     }
  316. }