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.     #[Groups(['getPunish'])]
  21.     private ?User $author null;
  22.     #[ORM\ManyToOne(inversedBy'punishDetails'cascade: ["persist"])]
  23.     #[ORM\JoinColumn(nullablefalse)]
  24.     #[Groups(['getPunish'])]
  25.     private ?Student $student null;
  26.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  27.     #[Groups(['getPunish'])]
  28.     private ?string $punishDetails null;
  29.     #[ORM\ManyToOne(inversedBy'punishes'cascade: ["persist"])]
  30.     #[ORM\JoinColumn(nullablefalse)]
  31.     #[Groups(['getPunish'])]
  32.     private ?SchoolYear $year null;
  33.     #[ORM\ManyToOne(inversedBy'punish'cascade: ["persist"])]
  34.     #[ORM\JoinColumn(nullablefalseonDelete"CASCADE")]
  35.     #[ORM\JoinColumn(nullablefalse)]
  36.     #[Groups(['getPunish'])]
  37.     private ?PunishCategory $category null;
  38.     #[ORM\ManyToOne(inversedBy'punishes'cascade: ["persist"])]
  39.     private ?School $school null;
  40.     #[ORM\ManyToOne(inversedBy'punishes')]
  41.     #[Groups(['getPunish'])]
  42.     private ?TheClass $classe null;
  43.     public function getId(): ?int
  44.     {
  45.         return $this->id;
  46.     }
  47.     public function getAuthor(): ?User
  48.     {
  49.         return $this->author;
  50.     }
  51.     public function setAuthor(?User $author): static
  52.     {
  53.         $this->author $author;
  54.         return $this;
  55.     }
  56.     public function getStudent(): ?Student
  57.     {
  58.         return $this->student;
  59.     }
  60.     public function setStudent(?Student $student): static
  61.     {
  62.         $this->student $student;
  63.         return $this;
  64.     }
  65.     public function getPunishDetails(): ?string
  66.     {
  67.         return $this->punishDetails;
  68.     }
  69.     public function setPunishDetails(?string $punishDetails): static
  70.     {
  71.         $this->punishDetails $punishDetails;
  72.         return $this;
  73.     }
  74.     public function getYear(): ?SchoolYear
  75.     {
  76.         return $this->year;
  77.     }
  78.     public function setYear(?SchoolYear $year): static
  79.     {
  80.         $this->year $year;
  81.         return $this;
  82.     }
  83.     public function getCategory(): ?PunishCategory
  84.     {
  85.         return $this->category;
  86.     }
  87.     public function setCategory(?PunishCategory $category): static
  88.     {
  89.         $this->category $category;
  90.         return $this;
  91.     }
  92.     public function getSchool(): ?School
  93.     {
  94.         return $this->school;
  95.     }
  96.     public function setSchool(?School $school): static
  97.     {
  98.         $this->school $school;
  99.         return $this;
  100.     }
  101.     public function getClasse(): ?TheClass
  102.     {
  103.         return $this->classe;
  104.     }
  105.     public function setClasse(?TheClass $classe): static
  106.     {
  107.         $this->classe $classe;
  108.         return $this;
  109.     }
  110. }