src/Entity/ScolarityHistory.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ScolarityHistoryRepository;
  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. use JMS\Serializer\Annotation\Groups;
  9. #[ORM\Entity(repositoryClassScolarityHistoryRepository::class)]
  10. class ScolarityHistory
  11. {
  12.     #[ORM\Id]
  13.     #[ORM\GeneratedValue]
  14.     #[ORM\Column]
  15.     #[Groups(['getScolarityHistory''getScolarity'])]
  16.     private ?int $id null;
  17.     #[ORM\ManyToMany(targetEntityStudentScolarity::class, inversedBy'scolarityHistories'cascade: ["persist"])]
  18.     #[Groups(['getScolarityHistory'])]
  19.     private Collection $scolarities;
  20.     #[ORM\Column]
  21.     #[Groups(['getScolarityHistory''getScolarity'])]
  22.     private ?\DateTimeImmutable $paidAt null;
  23.     #[ORM\Column(typeTypes::ARRAY, nullabletrue)]
  24.     #[Groups(['getScolarityHistory''getScolarity'])]
  25.     private ?array $amounts null;
  26.     #[ORM\Column]
  27.     #[Groups(['getScolarityHistory''getScolarity'])]
  28.     private ?int $totalAmount null;
  29.     #[ORM\ManyToOne(inversedBy'scolarityHistories')]
  30.     #[ORM\JoinColumn(nullablefalse)]
  31.     #[Groups(['getScolarityHistory'])]
  32.     private ?StudentYear $student null;
  33.     #[ORM\ManyToOne(inversedBy'scolarityHistories')]
  34.     private ?School $school null;
  35.     #[ORM\ManyToOne(inversedBy'scolarityHistories')]
  36.     #[ORM\JoinColumn(nullablefalse)]
  37.     private ?User $author null;
  38.     #[ORM\ManyToOne(inversedBy'scolarityHistories')]
  39.     private ?User $editor null;
  40.     #[ORM\Column(nullabletrue)]
  41.     private ?\DateTimeImmutable $updatedAt null;
  42.     #[ORM\OneToMany(mappedBy'history'targetEntityScolarityHistoryEdition::class, orphanRemovaltrue)]
  43.     private Collection $scolarityHistoryEditions;
  44.     #[ORM\Column(length255nullabletrue)]
  45.     private ?string $identifier null;
  46.     public function __construct()
  47.     {
  48.         $this->scolarities = new ArrayCollection();
  49.         $this->scolarityHistoryEditions = new ArrayCollection();
  50.     }
  51.     public function getId(): ?int
  52.     {
  53.         return $this->id;
  54.     }
  55.     /**
  56.      * @return Collection<int, StudentScolarity>
  57.      */
  58.     public function getScolarities(): Collection
  59.     {
  60.         return $this->scolarities;
  61.     }
  62.     public function addScolarity(StudentScolarity $scolarity): static
  63.     {
  64.         if (!$this->scolarities->contains($scolarity)) {
  65.             $this->scolarities->add($scolarity);
  66.         }
  67.         return $this;
  68.     }
  69.     public function removeScolarity(StudentScolarity $scolarity): static
  70.     {
  71.         $this->scolarities->removeElement($scolarity);
  72.         return $this;
  73.     }
  74.     public function getPaidAt(): ?\DateTimeImmutable
  75.     {
  76.         return $this->paidAt;
  77.     }
  78.     public function setPaidAt(\DateTimeImmutable $paidAt): static
  79.     {
  80.         $this->paidAt $paidAt;
  81.         return $this;
  82.     }
  83.     public function getAmounts(): ?array
  84.     {
  85.         return $this->amounts;
  86.     }
  87.     public function setAmounts(?array $amounts): static
  88.     {
  89.         $this->amounts $amounts;
  90.         return $this;
  91.     }
  92.     public function getTotalAmount(): ?int
  93.     {
  94.         return $this->totalAmount;
  95.     }
  96.     public function setTotalAmount(int $totalAmount): static
  97.     {
  98.         $this->totalAmount $totalAmount;
  99.         return $this;
  100.     }
  101.     public function getStudent(): ?StudentYear
  102.     {
  103.         return $this->student;
  104.     }
  105.     public function setStudent(?StudentYear $student): static
  106.     {
  107.         $this->student $student;
  108.         return $this;
  109.     }
  110.     public function getSchool(): ?School
  111.     {
  112.         return $this->school;
  113.     }
  114.     public function setSchool(?School $school): static
  115.     {
  116.         $this->school $school;
  117.         return $this;
  118.     }
  119.     public function getAuthor(): ?User
  120.     {
  121.         return $this->author;
  122.     }
  123.     public function setAuthor(?User $author): static
  124.     {
  125.         $this->author $author;
  126.         return $this;
  127.     }
  128.     public function getEditor(): ?User
  129.     {
  130.         return $this->editor;
  131.     }
  132.     public function setEditor(?User $editor): static
  133.     {
  134.         $this->editor $editor;
  135.         return $this;
  136.     }
  137.     public function getUpdatedAt(): ?\DateTimeImmutable
  138.     {
  139.         return $this->updatedAt;
  140.     }
  141.     public function setUpdatedAt(?\DateTimeImmutable $updatedAt): static
  142.     {
  143.         $this->updatedAt $updatedAt;
  144.         return $this;
  145.     }
  146.     /**
  147.      * @return Collection<int, ScolarityHistoryEdition>
  148.      */
  149.     public function getScolarityHistoryEditions(): Collection
  150.     {
  151.         return $this->scolarityHistoryEditions;
  152.     }
  153.     public function addScolarityHistoryEditon(ScolarityHistoryEdition $scolarityHistoryEdition): static
  154.     {
  155.         if (!$this->scolarityHistoryEditions->contains($scolarityHistoryEdition)) {
  156.             $this->scolarityHistoryEditions->add($scolarityHistoryEdition);
  157.             $scolarityHistoryEdition->setHistory($this);
  158.         }
  159.         return $this;
  160.     }
  161.     public function removeScolarityHistoryEdition(ScolarityHistoryEdition $scolarityHistoryEdition): static
  162.     {
  163.         if ($this->scolarityHistoryEditions->removeElement($scolarityHistoryEdition)) {
  164.             // set the owning side to null (unless already changed)
  165.             if ($scolarityHistoryEdition->getHistory() === $this) {
  166.                 $scolarityHistoryEdition->setHistory(null);
  167.             }
  168.         }
  169.         return $this;
  170.     }
  171.     public function getIdentifier(): ?string
  172.     {
  173.         return $this->identifier;
  174.     }
  175.     public function setIdentifier(?string $identifier): static
  176.     {
  177.         $this->identifier $identifier;
  178.         return $this;
  179.     }
  180. }