AttendanceBooking.php 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. <?php
  2. declare(strict_types=1);
  3. namespace App\Entity\Booking;
  4. use ApiPlatform\Core\Annotation\ApiResource;
  5. use App\Entity\Access\Access;
  6. use DH\Auditor\Provider\Doctrine\Auditing\Annotation\Auditable;
  7. use Doctrine\ORM\Mapping as ORM;
  8. /**
  9. * Classe ... qui ...
  10. */
  11. #[Auditable]
  12. #[ORM\Entity]
  13. #[ApiResource(
  14. collectionOperations:[],
  15. itemOperations: [
  16. "get" => ["security" => "is_granted('ROLE_ADMIN')"]
  17. ]
  18. )]
  19. class AttendanceBooking
  20. {
  21. #[ORM\Id]
  22. #[ORM\Column]
  23. #[ORM\GeneratedValue]
  24. private ?int $id = null;
  25. #[ORM\ManyToOne(inversedBy: 'attendanceBookings')]
  26. private Access $access;
  27. #[ORM\ManyToOne(inversedBy: 'attendanceBooking')]
  28. private Attendance $attendance;
  29. #[ORM\ManyToOne(inversedBy: 'attendanceBooking')]
  30. private Course $course;
  31. #[ORM\ManyToOne(inversedBy: 'attendanceBooking')]
  32. private EducationalProject $educationalProject;
  33. #[ORM\ManyToOne(inversedBy: 'attendanceBooking')]
  34. private Event $event;
  35. #[ORM\ManyToOne(inversedBy: 'attendanceBooking')]
  36. private Examen $examen;
  37. public function getId(): ?int
  38. {
  39. return $this->id;
  40. }
  41. public function getAccess(): ?Access
  42. {
  43. return $this->access;
  44. }
  45. public function setAccess(?Access $access): self
  46. {
  47. $this->access = $access;
  48. return $this;
  49. }
  50. public function getAttendance(): ?Attendance
  51. {
  52. return $this->attendance;
  53. }
  54. public function setAttendance(?Attendance $attendance): self
  55. {
  56. $this->attendance = $attendance;
  57. return $this;
  58. }
  59. public function getCourse(): ?Course
  60. {
  61. return $this->course;
  62. }
  63. public function setCourse(?Course $course): self
  64. {
  65. $this->course = $course;
  66. return $this;
  67. }
  68. public function getEducationalProject(): ?EducationalProject
  69. {
  70. return $this->educationalProject;
  71. }
  72. public function setEducationalProject(?EducationalProject $educationalProject): self
  73. {
  74. $this->educationalProject = $educationalProject;
  75. return $this;
  76. }
  77. public function getEvent(): ?Event
  78. {
  79. return $this->event;
  80. }
  81. public function setEvent(?Event $event): self
  82. {
  83. $this->event = $event;
  84. return $this;
  85. }
  86. public function getExamen(): ?Examen
  87. {
  88. return $this->examen;
  89. }
  90. public function setExamen(?Examen $examen): self
  91. {
  92. $this->examen = $examen;
  93. return $this;
  94. }
  95. }