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')]
  38.     #[Groups(['getPunish'])]
  39.     private ?TheClass $classe null;
  40.     public function getId(): ?int
  41.     {
  42.         return $this->id;
  43.     }
  44.     public function getAuthor(): ?User
  45.     {
  46.         return $this->author;
  47.     }
  48.     public function setAuthor(?User $author): static
  49.     {
  50.         $this->author $author;
  51.         return $this;
  52.     }
  53.     public function getStudent(): ?Student
  54.     {
  55.         return $this->student;
  56.     }
  57.     public function setStudent(?Student $student): static
  58.     {
  59.         $this->student $student;
  60.         return $this;
  61.     }
  62.     public function getPunishDetails(): ?string
  63.     {
  64.         return $this->punishDetails;
  65.     }
  66.     public function setPunishDetails(?string $punishDetails): static
  67.     {
  68.         $this->punishDetails $punishDetails;
  69.         return $this;
  70.     }
  71.     public function getYear(): ?SchoolYear
  72.     {
  73.         return $this->year;
  74.     }
  75.     public function setYear(?SchoolYear $year): static
  76.     {
  77.         $this->year $year;
  78.         return $this;
  79.     }
  80.     public function getCategory(): ?PunishCategory
  81.     {
  82.         return $this->category;
  83.     }
  84.     public function setCategory(?PunishCategory $category): static
  85.     {
  86.         $this->category $category;
  87.         return $this;
  88.     }
  89.     public function getSchool(): ?School
  90.     {
  91.         return $this->school;
  92.     }
  93.     public function setSchool(?School $school): static
  94.     {
  95.         $this->school $school;
  96.         return $this;
  97.     }
  98.     public function getClasse(): ?TheClass
  99.     {
  100.         return $this->classe;
  101.     }
  102.     public function setClasse(?TheClass $classe): static
  103.     {
  104.         $this->classe $classe;
  105.         return $this;
  106.     }
  107. }