src/Entity/Punish.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Entity\Traits\Timestampable;
  4. use App\Repository\PunishRepository;
  5. use Doctrine\DBAL\Types\Types;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use JMS\Serializer\Annotation\Groups;
  8. #[ORM\HasLifecycleCallbacks]
  9. #[ORM\Entity(repositoryClassPunishRepository::class)]
  10. class Punish
  11. {
  12.     use Timestampable;
  13.     #[ORM\Id]
  14.     #[ORM\GeneratedValue]
  15.     #[ORM\Column]
  16.     #[Groups(['getPunish'])]
  17.     private ?int $id null;
  18.     #[ORM\ManyToOne(inversedBy'punishes'cascade: ["persist"])]
  19.     #[ORM\JoinColumn(nullablefalse)]
  20.     private ?User $author null;
  21.     #[ORM\ManyToOne(inversedBy'punishDetails'cascade: ["persist"])]
  22.     #[ORM\JoinColumn(nullablefalse)]
  23.     #[Groups(['getPunish'])]
  24.     private ?Student $student null;
  25.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  26.     #[Groups(['getPunish'])]
  27.     private ?string $punishDetails null;
  28.     #[ORM\ManyToOne(inversedBy'punishes'cascade: ["persist"])]
  29.     #[ORM\JoinColumn(nullablefalse)]
  30.     private ?SchoolYear $year null;
  31.     #[ORM\ManyToOne(inversedBy'punish'cascade: ["persist"])]
  32.     #[ORM\JoinColumn(nullablefalse)]
  33.     #[Groups(['getPunish'])]
  34.     private ?PunishCategory $category null;
  35.     #[ORM\ManyToOne(inversedBy'punishes'cascade: ["persist"])]
  36.     private ?School $school null;
  37.     #[ORM\ManyToOne(inversedBy'punishes'cascade: ["persist"])]
  38.     #[ORM\JoinColumn(nullablefalse)]
  39.     private ?Exams $exam null;
  40.     #[ORM\ManyToOne(inversedBy'punishes')]
  41.     private ?TheClass $classe null;
  42.     public function getId(): ?int
  43.     {
  44.         return $this->id;
  45.     }
  46.     public function getAuthor(): ?User
  47.     {
  48.         return $this->author;
  49.     }
  50.     public function setAuthor(?User $author): static
  51.     {
  52.         $this->author $author;
  53.         return $this;
  54.     }
  55.     public function getStudent(): ?Student
  56.     {
  57.         return $this->student;
  58.     }
  59.     public function setStudent(?Student $student): static
  60.     {
  61.         $this->student $student;
  62.         return $this;
  63.     }
  64.     public function getPunishDetails(): ?string
  65.     {
  66.         return $this->punishDetails;
  67.     }
  68.     public function setPunishDetails(?string $punishDetails): static
  69.     {
  70.         $this->punishDetails $punishDetails;
  71.         return $this;
  72.     }
  73.     public function getYear(): ?SchoolYear
  74.     {
  75.         return $this->year;
  76.     }
  77.     public function setYear(?SchoolYear $year): static
  78.     {
  79.         $this->year $year;
  80.         return $this;
  81.     }
  82.     public function getCategory(): ?PunishCategory
  83.     {
  84.         return $this->category;
  85.     }
  86.     public function setCategory(?PunishCategory $category): static
  87.     {
  88.         $this->category $category;
  89.         return $this;
  90.     }
  91.     public function getSchool(): ?School
  92.     {
  93.         return $this->school;
  94.     }
  95.     public function setSchool(?School $school): static
  96.     {
  97.         $this->school $school;
  98.         return $this;
  99.     }
  100.     public function getExam(): ?Exams
  101.     {
  102.         return $this->exam;
  103.     }
  104.     public function setExam(?Exams $exam): static
  105.     {
  106.         $this->exam $exam;
  107.         return $this;
  108.     }
  109.     public function getClasse(): ?TheClass
  110.     {
  111.         return $this->classe;
  112.     }
  113.     public function setClasse(?TheClass $classe): static
  114.     {
  115.         $this->classe $classe;
  116.         return $this;
  117.     }
  118. }