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