Access.php 63 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989
  1. <?php
  2. declare (strict_types=1);
  3. namespace App\Entity\Access;
  4. use ApiPlatform\Metadata\ApiResource;
  5. use ApiPlatform\Doctrine\Orm\Filter\BooleanFilter;
  6. use ApiPlatform\Metadata\ApiFilter;
  7. use ApiPlatform\Metadata\Get;
  8. use ApiPlatform\Metadata\Put;
  9. use App\Entity\AccessWish\AccessWish;
  10. use App\Entity\Billing\AccessBilling;
  11. use App\Entity\Billing\AccessFictionalIntangible;
  12. use App\Entity\Billing\Bill;
  13. use App\Entity\Billing\BillCredit;
  14. use App\Entity\Billing\BillLine;
  15. use App\Entity\Billing\EducationalProjectPayer;
  16. use App\Entity\Booking\Attendance;
  17. use App\Entity\Booking\AttendanceBooking;
  18. use App\Entity\Booking\Course;
  19. use App\Entity\Booking\EducationalProject;
  20. use App\Entity\Booking\Event;
  21. use App\Entity\Booking\EventUser;
  22. use App\Entity\Booking\ExamenConvocation;
  23. use App\Entity\Booking\PersonHoliday;
  24. use App\Entity\Booking\WorkByUser;
  25. use App\Entity\Core\Tagg;
  26. use App\Entity\Donor\Donor;
  27. use App\Entity\Education\EducationNotationConfig;
  28. use App\Entity\Education\EducationStudent;
  29. use App\Entity\Education\EducationTeacher;
  30. use App\Entity\Message\Email;
  31. use App\Entity\Message\Mail;
  32. use App\Entity\Message\Sms;
  33. use App\Entity\Organization\Jury;
  34. use App\Entity\Organization\Parameters;
  35. use App\Entity\Person\CommissionMember;
  36. use App\Entity\Person\CompanyPerson;
  37. use App\Entity\Person\Medal;
  38. use App\Entity\Product\Equipment;
  39. use App\Entity\Product\EquipmentLoan;
  40. use App\Filter\Person\FullNameFilter;
  41. use App\Entity\Billing\AccessIntangible;
  42. use App\Entity\Billing\AccessPayer;
  43. use App\Entity\Core\Notification;
  44. use App\Entity\Core\NotificationUser;
  45. use App\Entity\Organization\Organization;
  46. use App\Entity\Organization\OrganizationLicence;
  47. use App\Filter\Utils\InFilter;
  48. use App\Repository\Access\AccessRepository;
  49. use App\Entity\Person\Person;
  50. use App\Entity\Person\PersonActivity;
  51. use App\Entity\Place\PlaceRepair;
  52. use App\Entity\Place\RoomRepair;
  53. use App\Entity\Product\EquipmentRepair;
  54. //use DH\Auditor\Provider\Doctrine\Auditing\Annotation\Auditable;
  55. use Doctrine\Common\Collections\ArrayCollection;
  56. use Doctrine\Common\Collections\Collection;
  57. use Doctrine\ORM\Mapping as ORM;
  58. use JetBrains\PhpStorm\Pure;
  59. use Symfony\Component\Security\Core\Role\Role;
  60. use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface;
  61. use Symfony\Component\Security\Core\User\UserInterface;
  62. use Symfony\Component\Serializer\Annotation\Groups;
  63. /**
  64. * Fais le lien entre une Person et une Organization
  65. */
  66. #[ApiResource] // @see config/api_platform/Access/access.yaml
  67. //#[Auditable]
  68. #[ORM\Entity(repositoryClass: AccessRepository::class)]
  69. #[ApiFilter(filterClass: BooleanFilter::class, properties: ['person.isPhysical'])]
  70. #[ApiFilter(filterClass: FullNameFilter::class)]
  71. #[ApiFilter(filterClass: InFilter::class, properties: ['id'])]
  72. class Access implements UserInterface, PasswordAuthenticatedUserInterface
  73. {
  74. #[ORM\Id]
  75. #[ORM\Column]
  76. #[ORM\GeneratedValue]
  77. #[Groups("access_people_ref")]
  78. private ?int $id = null;
  79. #[ORM\Column(options: ['default' => false])]
  80. private bool $adminAccess = false;
  81. #[ORM\Column(options: ['default' => false])]
  82. #[Groups(['private'])]
  83. private bool $superAdminAccess = false;
  84. #[ORM\Column(nullable: true)]
  85. #[Groups(['my_access:input'])]
  86. private ?int $activityYear = null;
  87. #[ORM\ManyToOne(cascade: ['persist'], inversedBy: 'access')]
  88. #[ORM\JoinColumn(nullable: false)]
  89. #[Groups(["access_people_ref", "access_address"])]
  90. private Person $person;
  91. #[ORM\ManyToOne(inversedBy: 'accesses')]
  92. #[ORM\JoinColumn(nullable: false)]
  93. private Organization $organization;
  94. /** @var mixed[]|null */
  95. #[ORM\Column(type: 'json', length: 4294967295, nullable: true)]
  96. private ?array $roles = [];
  97. /** @var mixed[]|null */
  98. #[Groups(['my_access:input'])]
  99. #[ORM\Column(type: 'json', length: 4294967295, nullable: true)]
  100. private ?array $setting = [];
  101. #[ORM\OneToOne(mappedBy: 'access', cascade: ['persist'], orphanRemoval: true)]
  102. private AccessBilling $accessBilling;
  103. #[ORM\OneToMany(mappedBy: 'access', targetEntity: PersonActivity::class, cascade: ['persist'], orphanRemoval: true)]
  104. private Collection $personActivity;
  105. #[ORM\OneToMany(mappedBy: 'access', targetEntity: OrganizationFunction::class, cascade: ['persist'], orphanRemoval: true)]
  106. private Collection $organizationFunction;
  107. #[ORM\OneToMany(mappedBy: 'licensee', targetEntity: OrganizationLicence::class, cascade: ['persist'], orphanRemoval: true)]
  108. private Collection $organizationLicences;
  109. #[ORM\OneToMany(mappedBy: 'access', targetEntity: PersonalizedList::class, cascade: ['persist'], orphanRemoval: true)]
  110. private Collection $personalizedLists;
  111. #[ORM\OneToMany(mappedBy: 'recipientAccess', targetEntity: Notification::class, orphanRemoval: true)]
  112. private Collection $notifications;
  113. #[ORM\OneToMany(mappedBy: 'access', targetEntity: NotificationUser::class, orphanRemoval: true)]
  114. private Collection $notificationUsers;
  115. #[ORM\ManyToMany(targetEntity: Access::class, mappedBy: 'children', cascade: ['persist'])]
  116. private Collection $guardians;
  117. #[ORM\ManyToMany(targetEntity: Access::class, inversedBy: 'guardians', cascade: ['persist'])]
  118. #[ORM\JoinTable(name: 'children_guardians')]
  119. #[ORM\JoinColumn(name: 'guardians_id', referencedColumnName: 'id')]
  120. #[ORM\InverseJoinColumn(name: 'children_id', referencedColumnName: 'id')]
  121. private Collection $children;
  122. #[ORM\OneToMany(mappedBy: 'accessPayer', targetEntity: AccessPayer::class, cascade: ['persist'], orphanRemoval: true)]
  123. private Collection $billingPayers;
  124. #[ORM\OneToMany(mappedBy: 'accessReceiver', targetEntity: AccessPayer::class, cascade: ['persist'], orphanRemoval: true)]
  125. private Collection $billingReceivers;
  126. #[ORM\OneToMany(mappedBy: 'access', targetEntity: AccessIntangible::class, cascade: ['persist'], orphanRemoval: true)]
  127. private Collection $accessIntangibles;
  128. #[ORM\ManyToOne(inversedBy: 'publicationDirectors')]
  129. #[ORM\JoinColumn(referencedColumnName: 'id', nullable: false)]
  130. private ?Parameters $publicationDirector;
  131. #[ORM\ManyToOne(inversedBy: 'teachers')]
  132. #[ORM\JoinColumn(referencedColumnName: 'id', nullable: true, onDelete: 'SET NULL')]
  133. private ?EducationNotationConfig $educationNotationConfig;
  134. #[ORM\OneToMany(mappedBy: 'company', targetEntity: CompanyPerson::class, cascade: ['persist'], orphanRemoval: true)]
  135. private Collection $companyPersonAccesses;
  136. #[ORM\OneToMany(mappedBy: 'access', targetEntity: CompanyPerson::class, cascade: ['persist'], orphanRemoval: true)]
  137. private Collection $companyPersonCompany;
  138. #[ORM\OneToMany(mappedBy: 'access', targetEntity: EducationStudent::class, cascade: ['persist'], orphanRemoval: true)]
  139. private Collection $educationStudent;
  140. #[ORM\ManyToMany(targetEntity: EducationStudent::class, mappedBy: 'teachers', cascade: ['persist'], orphanRemoval: true)]
  141. private Collection $educationStudentByTeacher;
  142. #[ORM\OneToMany(mappedBy: 'teacher', targetEntity: EducationTeacher::class, orphanRemoval: true)]
  143. private Collection $educationTeachers;
  144. #[ORM\OneToMany(mappedBy: 'access', targetEntity: PersonHoliday::class, cascade: ['persist'], orphanRemoval: true)]
  145. private Collection $holidays;
  146. #[ORM\ManyToMany(targetEntity: Course::class, mappedBy: 'students', cascade: ['persist'])]
  147. private Collection $courses;
  148. #[ORM\ManyToMany(targetEntity: Course::class, mappedBy: 'organizer', cascade: ['persist'])]
  149. private Collection $practicalCourses;
  150. #[ORM\ManyToMany(targetEntity: Event::class, mappedBy: 'organizer', cascade: ['persist'])]
  151. private Collection $eventOrganizers;
  152. #[ORM\ManyToMany(targetEntity: EducationalProject::class, mappedBy: 'organizer', cascade: ['persist'])]
  153. private Collection $educationalProjectOrganizers;
  154. #[ORM\ManyToOne(cascade: ['persist'], inversedBy: 'accesses')]
  155. #[ORM\JoinColumn(referencedColumnName: 'id', nullable: false, onDelete: "SET NULL")]
  156. private AccessFamily $accessFamily;
  157. #[ORM\OneToMany(mappedBy: 'educationalProjectPayer', targetEntity: EducationalProjectPayer::class, cascade: ['persist'], orphanRemoval: true)]
  158. private Collection $billingEducationalProjectPayers;
  159. #[ORM\OneToMany(mappedBy: 'access', targetEntity: Bill::class, orphanRemoval: true)]
  160. private Collection $bills;
  161. #[ORM\OneToMany(mappedBy: 'access', targetEntity: BillLine::class, orphanRemoval: true)]
  162. private Collection $billLines;
  163. #[ORM\OneToMany(mappedBy: 'access', targetEntity: BillCredit::class, orphanRemoval: true)]
  164. private Collection $billCredits;
  165. #[ORM\OneToMany(mappedBy: 'silentPartner', targetEntity: EducationalProject::class)]
  166. private Collection $silentPartners;
  167. #[ORM\OneToMany(mappedBy: 'operationalPartner', targetEntity: EducationalProject::class)]
  168. private Collection $operationalPartners;
  169. #[ORM\OneToMany(mappedBy: 'guest', targetEntity: EventUser::class, orphanRemoval: true)]
  170. private Collection $eventUsers;
  171. #[ORM\OneToMany(mappedBy: 'student', targetEntity: ExamenConvocation::class, orphanRemoval: true)]
  172. private Collection $examenConvocations;
  173. #[ORM\OneToMany(mappedBy: 'provider', targetEntity: EquipmentRepair::class)]
  174. private Collection $equipmentRepairProviders;
  175. #[ORM\OneToMany(mappedBy: 'access', targetEntity: Attendance::class, orphanRemoval: true)]
  176. private Collection $attendances;
  177. #[ORM\OneToMany(mappedBy: 'access', targetEntity: AttendanceBooking::class, orphanRemoval: true)]
  178. private Collection $attendanceBookings;
  179. #[ORM\OneToMany(mappedBy: 'replacement', targetEntity: Attendance::class)]
  180. private Collection $attendanceReplacements;
  181. #[ORM\OneToMany(mappedBy: 'provider', targetEntity: RoomRepair::class)]
  182. private Collection $roomRepairProviders;
  183. #[ORM\OneToMany(mappedBy: 'provider', targetEntity: PlaceRepair::class)]
  184. private Collection $placeRepairProviders;
  185. #[ORM\OneToMany(mappedBy: 'author', targetEntity: Email::class)]
  186. private Collection $emails;
  187. #[ORM\OneToMany(mappedBy: 'author', targetEntity: Mail::class)]
  188. private Collection $mails;
  189. #[ORM\OneToMany(mappedBy: 'author', targetEntity: Sms::class)]
  190. private Collection $sms;
  191. #[ORM\ManyToMany(targetEntity: Jury::class, mappedBy: 'members', orphanRemoval: true)]
  192. private Collection $juryMembers;
  193. #[ORM\OneToMany(mappedBy: 'contactPerson', targetEntity: Organization::class)]
  194. private Collection $organizationContacts;
  195. #[ORM\OneToMany(mappedBy: 'member', targetEntity: CommissionMember::class, orphanRemoval: true)]
  196. private Collection $commissionMembers;
  197. #[ORM\OneToMany(mappedBy: 'supplier', targetEntity: Equipment::class)]
  198. private Collection $equipmentSuppliers;
  199. #[ORM\OneToMany(mappedBy: 'controlManager', targetEntity: Equipment::class)]
  200. private Collection $equipmentControlManagers;
  201. #[ORM\OneToMany(mappedBy: 'editor', targetEntity: Equipment::class)]
  202. private Collection $equipmentEditors;
  203. #[ORM\OneToMany(mappedBy: 'borrower', targetEntity: EquipmentLoan::class, cascade: ['persist'], orphanRemoval: true)]
  204. private Collection $equipmentLoans;
  205. #[ORM\OneToMany(mappedBy: 'access', targetEntity: Equipment::class, cascade: ['persist'], orphanRemoval: true)]
  206. private Collection $equipments;
  207. #[ORM\OneToMany(mappedBy: 'access', targetEntity: AccessFictionalIntangible::class, cascade: ['persist'], orphanRemoval: true)]
  208. private Collection $accessFictionalIntangibles;
  209. #[ORM\OneToMany(mappedBy: 'access', targetEntity: Donor::class, cascade: ['persist'], orphanRemoval: true)]
  210. private Collection $donors;
  211. #[ORM\OneToMany(mappedBy: 'access', targetEntity: Medal::class, cascade: ['persist'], orphanRemoval: true)]
  212. private Collection $medals;
  213. #[ORM\OneToMany(mappedBy: 'access', targetEntity: OrganizationResponsability::class, cascade: ['persist'], orphanRemoval: true)]
  214. private Collection $organizationResponsabilities;
  215. #[ORM\OneToMany(mappedBy: 'accessOriginal', targetEntity: AccessWish::class, cascade: ['persist', 'remove'], fetch: 'EAGER', orphanRemoval: true)]
  216. private Collection $accessWishes;
  217. #[ORM\OneToMany(mappedBy: 'student', targetEntity: WorkByUser::class, cascade: ['persist'], orphanRemoval: true)]
  218. private Collection $workByUsers;
  219. #[ORM\ManyToMany(targetEntity: Tagg::class, inversedBy: 'accesses', cascade: ['persist'])]
  220. #[ORM\JoinTable(name: 'tag_access')]
  221. #[ORM\JoinColumn(name: 'access_id', referencedColumnName: 'id')]
  222. #[ORM\InverseJoinColumn(name: 'tag_id', referencedColumnName: 'id')]
  223. private Collection $tags;
  224. #[Pure]
  225. public function __construct()
  226. {
  227. $this->personActivity = new ArrayCollection();
  228. $this->organizationFunction = new ArrayCollection();
  229. $this->organizationLicences = new ArrayCollection();
  230. $this->personalizedLists = new ArrayCollection();
  231. $this->guardians = new ArrayCollection();
  232. $this->children = new ArrayCollection();
  233. $this->billingPayers = new ArrayCollection();
  234. $this->billingReceivers = new ArrayCollection();
  235. $this->accessIntangibles = new ArrayCollection();
  236. $this->notifications = new ArrayCollection();
  237. $this->notificationUsers = new ArrayCollection();
  238. $this->companyPersonAccesses = new ArrayCollection();
  239. $this->companyPersonCompany = new ArrayCollection();
  240. $this->educationStudent = new ArrayCollection();
  241. $this->educationStudentByTeacher = new ArrayCollection();
  242. $this->educationTeachers = new ArrayCollection();
  243. $this->holidays = new ArrayCollection();
  244. $this->courses = new ArrayCollection();
  245. $this->practicalCourses = new ArrayCollection();
  246. $this->billingEducationalProjectPayers = new ArrayCollection();
  247. $this->bills = new ArrayCollection();
  248. $this->billLines = new ArrayCollection();
  249. $this->billCredits = new ArrayCollection();
  250. $this->silentPartners = new ArrayCollection();
  251. $this->operationalPartners = new ArrayCollection();
  252. $this->eventUsers = new ArrayCollection();
  253. $this->examenConvocations = new ArrayCollection();
  254. $this->equipmentRepairProviders = new ArrayCollection();
  255. $this->attendances = new ArrayCollection();
  256. $this->attendanceBookings = new ArrayCollection();
  257. $this->attendanceReplacements = new ArrayCollection();
  258. $this->roomRepairProviders = new ArrayCollection();
  259. $this->placeRepairProviders = new ArrayCollection();
  260. $this->juryMembers = new ArrayCollection();
  261. $this->organizationContacts = new ArrayCollection();
  262. $this->commissionMembers = new ArrayCollection();
  263. $this->equipmentSuppliers = new ArrayCollection();
  264. $this->equipmentControlManagers = new ArrayCollection();
  265. $this->equipmentEditors = new ArrayCollection();
  266. $this->equipmentLoans = new ArrayCollection();
  267. $this->equipments = new ArrayCollection();
  268. $this->accessFictionalIntangibles = new ArrayCollection();
  269. $this->donors = new ArrayCollection();
  270. $this->medals = new ArrayCollection();
  271. $this->organizationResponsabilities = new ArrayCollection();
  272. $this->accessWishes = new ArrayCollection();
  273. $this->workByUsers = new ArrayCollection();
  274. $this->tags = new ArrayCollection();
  275. $this->eventOrganizers = new ArrayCollection();
  276. $this->educationalProjectOrganizers = new ArrayCollection();
  277. $this->emails = new ArrayCollection();
  278. $this->mails = new ArrayCollection();
  279. $this->sms = new ArrayCollection();
  280. }
  281. public function getId(): ?int
  282. {
  283. return $this->id;
  284. }
  285. public function getAdminAccess(): ?bool
  286. {
  287. return $this->adminAccess;
  288. }
  289. public function setAdminAccess(bool $adminAccess): self
  290. {
  291. $this->adminAccess = $adminAccess;
  292. return $this;
  293. }
  294. public function getSuperAdminAccess(): ?bool
  295. {
  296. return $this->superAdminAccess;
  297. }
  298. public function setSuperAdminAccess(bool $superAdminAccess): self
  299. {
  300. $this->superAdminAccess = $superAdminAccess;
  301. return $this;
  302. }
  303. public function getPerson(): ?Person
  304. {
  305. return $this->person;
  306. }
  307. public function setPerson(?Person $person): self
  308. {
  309. $this->person = $person;
  310. return $this;
  311. }
  312. public function getOrganization(): ?Organization
  313. {
  314. return $this->organization;
  315. }
  316. public function setOrganization(?Organization $organization): self
  317. {
  318. $this->organization = $organization;
  319. return $this;
  320. }
  321. public function getActivityYear(): ?int
  322. {
  323. return $this->activityYear;
  324. }
  325. public function setActivityYear(?int $activityYear): self
  326. {
  327. $this->activityYear = $activityYear;
  328. return $this;
  329. }
  330. /**
  331. * @return array<mixed>
  332. */
  333. public function getHistorical(): array
  334. {
  335. return array_key_exists('historical', $this->setting) && $this->setting['historical'] ? $this->setting['historical'] : ['present' => true];
  336. }
  337. /**
  338. * @param array<mixed> $historical
  339. * @return $this
  340. */
  341. #[Groups(['my_access:input'])]
  342. public function setHistorical(array $historical): self
  343. {
  344. // Une entrée dateStart mais pas de dateEnd, on retire dateEnd
  345. if (array_key_exists('dateStart', $historical) && !array_key_exists('dateEnd', $historical)) {
  346. unset($historical['dateStart']);
  347. }
  348. // Une entrée dateEnd mais pas de dateStart, on retire dateEnd
  349. else if (!array_key_exists('dateStart', $historical) && array_key_exists('dateEnd', $historical)) {
  350. unset($historical['dateEnd']);
  351. }
  352. // Les entrées dateStart et dateEnd existent mais ne sont pas toutes les deux renseignées, on retire les deux
  353. if (
  354. array_key_exists('dateStart', $historical) &&
  355. array_key_exists('dateEnd', $historical) &&
  356. (!$historical['dateStart'] || !$historical['dateEnd'])
  357. ) {
  358. unset($historical['dateStart']);
  359. unset($historical['dateEnd']);
  360. }
  361. // Aucun temps ni période n'est défini, on définit par défaut present à vrai
  362. if (!$historical['past'] && !$historical['present'] && !$historical['future'] && !array_key_exists('dateStart', $historical) ) {
  363. $historical['present'] = true;
  364. }
  365. $this->setting['historical'] = $historical;
  366. return $this;
  367. }
  368. /**
  369. * @param mixed[]|null $roles
  370. * @return $this
  371. */
  372. public function setRoles(?array $roles): self
  373. {
  374. $this->roles = $roles;
  375. return $this;
  376. }
  377. /**
  378. * @return mixed[]
  379. */
  380. public function getRoles(): array
  381. {
  382. $roles = $this->roles;
  383. return array_unique($roles ?? []);
  384. }
  385. public function getPersonActivity(): Collection
  386. {
  387. return $this->personActivity;
  388. }
  389. public function addPersonActivity(PersonActivity $personActivity): self
  390. {
  391. if (!$this->personActivity->contains($personActivity)) {
  392. $this->personActivity[] = $personActivity;
  393. $personActivity->setAccess($this);
  394. }
  395. return $this;
  396. }
  397. public function removePersonActivity(PersonActivity $personActivity): self
  398. {
  399. if ($this->personActivity->removeElement($personActivity)) {
  400. // set the owning side to null (unless already changed)
  401. if ($personActivity->getAccess() === $this) {
  402. $personActivity->setAccess(null);
  403. }
  404. }
  405. return $this;
  406. }
  407. public function getOrganizationFunction(): Collection
  408. {
  409. return $this->organizationFunction;
  410. }
  411. public function addOrganizationFunction(OrganizationFunction $organizationFunction): self
  412. {
  413. if (!$this->organizationFunction->contains($organizationFunction)) {
  414. $this->organizationFunction[] = $organizationFunction;
  415. $organizationFunction->setAccess($this);
  416. }
  417. return $this;
  418. }
  419. public function removeOrganizationFunction(OrganizationFunction $organizationFunction): self
  420. {
  421. if ($this->organizationFunction->removeElement($organizationFunction)) {
  422. // set the owning side to null (unless already changed)
  423. if ($organizationFunction->getAccess() === $this) {
  424. $organizationFunction->setAccess(null);
  425. }
  426. }
  427. return $this;
  428. }
  429. public function getOrganizationLicences(): Collection
  430. {
  431. return $this->organizationLicences;
  432. }
  433. public function addOrganizationLicence(OrganizationLicence $organizationLicence): self
  434. {
  435. if (!$this->organizationLicences->contains($organizationLicence)) {
  436. $this->organizationLicences[] = $organizationLicence;
  437. $organizationLicence->setLicensee($this);
  438. }
  439. return $this;
  440. }
  441. public function removeOrganizationLicence(OrganizationLicence $organizationLicence): self
  442. {
  443. if ($this->organizationLicences->removeElement($organizationLicence)) {
  444. // set the owning side to null (unless already changed)
  445. if ($organizationLicence->getLicensee() === $this) {
  446. $organizationLicence->setLicensee(null);
  447. }
  448. }
  449. return $this;
  450. }
  451. public function getPersonalizedLists(): Collection
  452. {
  453. return $this->personalizedLists;
  454. }
  455. public function addPersonalizedList(PersonalizedList $personalizedList): self
  456. {
  457. if (!$this->personalizedLists->contains($personalizedList)) {
  458. $this->personalizedLists[] = $personalizedList;
  459. $personalizedList->setAccess($this);
  460. }
  461. return $this;
  462. }
  463. public function removePersonalizedList(PersonalizedList $personalizedList): self
  464. {
  465. if ($this->personalizedLists->removeElement($personalizedList)) {
  466. // set the owning side to null (unless already changed)
  467. if ($personalizedList->getAccess() === $this) {
  468. $personalizedList->setAccess(null);
  469. }
  470. }
  471. return $this;
  472. }
  473. public function getChildren(): Collection
  474. {
  475. return $this->children;
  476. }
  477. public function addChild(Access $access): self
  478. {
  479. if (!$this->children->contains($access)) {
  480. $this->children[] = $access;
  481. $access->addGuardian($this);
  482. }
  483. return $this;
  484. }
  485. public function removeChild(Access $access): self
  486. {
  487. if ($this->children->removeElement($access)) {
  488. $access->removeGuardian($this);
  489. }
  490. return $this;
  491. }
  492. public function getGuardians(): Collection
  493. {
  494. return $this->guardians;
  495. }
  496. public function addGuardian(Access $access): self
  497. {
  498. if (!$this->guardians->contains($access)) {
  499. $this->guardians[] = $access;
  500. $access->addChild($this);
  501. }
  502. return $this;
  503. }
  504. public function removeGuardian(Access $access): self
  505. {
  506. if ($this->guardians->removeElement($access)) {
  507. $access->removeChild($this);
  508. }
  509. return $this;
  510. }
  511. public function getBillingPayers(): Collection
  512. {
  513. return $this->billingPayers;
  514. }
  515. public function addBillingPayer(AccessPayer $billingPayer): self
  516. {
  517. if (!$this->billingPayers->contains($billingPayer)) {
  518. $this->billingPayers[] = $billingPayer;
  519. $billingPayer->setAccessPayer($this);
  520. }
  521. return $this;
  522. }
  523. public function removeBillingPayer(AccessPayer $billingPayer): self
  524. {
  525. if ($this->billingPayers->removeElement($billingPayer)) {
  526. // set the owning side to null (unless already changed)
  527. if ($billingPayer->getAccessPayer() === $this) {
  528. $billingPayer->setAccessPayer(null);
  529. }
  530. }
  531. return $this;
  532. }
  533. public function getBillingReceivers(): Collection
  534. {
  535. return $this->billingReceivers;
  536. }
  537. public function addBillingReceiver(AccessPayer $billingReceiver): self
  538. {
  539. if (!$this->billingReceivers->contains($billingReceiver)) {
  540. $this->billingReceivers[] = $billingReceiver;
  541. $billingReceiver->setAccessReceiver($this);
  542. }
  543. return $this;
  544. }
  545. public function removeBillingReceiver(AccessPayer $billingPayer): self
  546. {
  547. if ($this->billingReceivers->removeElement($billingPayer)) {
  548. // set the owning side to null (unless already changed)
  549. if ($billingPayer->getAccessReceiver() === $this) {
  550. $billingPayer->setAccessReceiver(null);
  551. }
  552. }
  553. return $this;
  554. }
  555. public function getAccessIntangibles(): Collection
  556. {
  557. return $this->accessIntangibles;
  558. }
  559. public function addAccessIntangible(AccessIntangible $accessIntangibles): self
  560. {
  561. if (!$this->accessIntangibles->contains($accessIntangibles)) {
  562. $this->accessIntangibles[] = $accessIntangibles;
  563. $accessIntangibles->setAccess($this);
  564. }
  565. return $this;
  566. }
  567. public function removeAccessIntangible(AccessIntangible $accessIntangibles): self
  568. {
  569. if ($this->accessIntangibles->removeElement($accessIntangibles)) {
  570. // set the owning side to null (unless already changed)
  571. if ($accessIntangibles->getAccess() === $this) {
  572. $accessIntangibles->setAccess(null);
  573. }
  574. }
  575. return $this;
  576. }
  577. public function getNotifications(): Collection
  578. {
  579. return $this->notifications;
  580. }
  581. public function addNotification(Notification $notification): self
  582. {
  583. if (!$this->notifications->contains($notification)) {
  584. $this->notifications[] = $notification;
  585. $notification->setRecipientAccess($this);
  586. }
  587. return $this;
  588. }
  589. public function removeNotification(Notification $notification): self
  590. {
  591. if ($this->notifications->removeElement($notification)) {
  592. // set the owning side to null (unless already changed)
  593. if ($notification->getRecipientAccess() === $this) {
  594. $notification->setRecipientAccess(null);
  595. }
  596. }
  597. return $this;
  598. }
  599. public function getNotificationUsers(): Collection
  600. {
  601. return $this->notificationUsers;
  602. }
  603. public function addNotificationUser(NotificationUser $notificationUser): self
  604. {
  605. if (!$this->notificationUsers->contains($notificationUser)) {
  606. $this->notificationUsers[] = $notificationUser;
  607. $notificationUser->setAccess($this);
  608. }
  609. return $this;
  610. }
  611. public function removeNotificationUser(NotificationUser $notificationUser): self
  612. {
  613. if ($this->notificationUsers->removeElement($notificationUser)) {
  614. // set the owning side to null (unless already changed)
  615. if ($notificationUser->getAccess() === $this) {
  616. $notificationUser->setAccess(null);
  617. }
  618. }
  619. return $this;
  620. }
  621. public function getPublicationDirector(): ?Parameters
  622. {
  623. return $this->publicationDirector;
  624. }
  625. public function setPublicationDirector(?Parameters $parameters): self
  626. {
  627. $this->publicationDirector = $parameters;
  628. return $this;
  629. }
  630. public function getEducationNotationConfig(): ?EducationNotationConfig
  631. {
  632. return $this->educationNotationConfig;
  633. }
  634. public function setEducationNotationConfig(?EducationNotationConfig $educationNotationConfig): self
  635. {
  636. $this->educationNotationConfig = $educationNotationConfig;
  637. return $this;
  638. }
  639. #[Pure]
  640. public function getUserIdentifier(): string
  641. {
  642. return $this->person->getUserIdentifier();
  643. }
  644. public function getPassword(): ?string
  645. {
  646. return null;
  647. }
  648. public function getSalt(): ?string
  649. {
  650. return null;
  651. }
  652. public function getUsername(): ?string
  653. {
  654. return null;
  655. }
  656. public function eraseCredentials(): void
  657. {
  658. // TODO: Implement eraseCredentials() method.
  659. }
  660. /**
  661. * @return mixed[]|null
  662. */
  663. public function getSetting(): ?array
  664. {
  665. return $this->setting;
  666. }
  667. /**
  668. * @param mixed[]|null $setting
  669. * @return $this
  670. */
  671. public function setSetting(?array $setting): self
  672. {
  673. $this->setting = $setting;
  674. return $this;
  675. }
  676. /**
  677. * @return Collection<int, CompanyPerson>
  678. */
  679. public function getCompanyPersonAccesses(): Collection
  680. {
  681. return $this->companyPersonAccesses;
  682. }
  683. public function addCompanyPersonAccess(CompanyPerson $companyPersonAccess): self
  684. {
  685. if (!$this->companyPersonAccesses->contains($companyPersonAccess)) {
  686. $this->companyPersonAccesses[] = $companyPersonAccess;
  687. $companyPersonAccess->setCompany($this);
  688. }
  689. return $this;
  690. }
  691. public function removeCompanyPersonAccess(CompanyPerson $companyPersonAccess): self
  692. {
  693. if ($this->companyPersonAccesses->removeElement($companyPersonAccess)) {
  694. // set the owning side to null (unless already changed)
  695. if ($companyPersonAccess->getCompany() === $this) {
  696. $companyPersonAccess->setCompany(null);
  697. }
  698. }
  699. return $this;
  700. }
  701. /**
  702. * @return Collection<int, CompanyPerson>
  703. */
  704. public function getCompanyPersonCompany(): Collection
  705. {
  706. return $this->companyPersonCompany;
  707. }
  708. public function addCompanyPersonCompany(CompanyPerson $companyPersonCompany): self
  709. {
  710. if (!$this->companyPersonCompany->contains($companyPersonCompany)) {
  711. $this->companyPersonCompany[] = $companyPersonCompany;
  712. $companyPersonCompany->setAccess($this);
  713. }
  714. return $this;
  715. }
  716. public function removeCompanyPersonCompany(CompanyPerson $companyPersonCompany): self
  717. {
  718. if ($this->companyPersonCompany->removeElement($companyPersonCompany)) {
  719. // set the owning side to null (unless already changed)
  720. if ($companyPersonCompany->getAccess() === $this) {
  721. $companyPersonCompany->setAccess(null);
  722. }
  723. }
  724. return $this;
  725. }
  726. /**
  727. * @return Collection<int, EducationStudent>
  728. */
  729. public function getEducationStudent(): Collection
  730. {
  731. return $this->educationStudent;
  732. }
  733. public function addEducationStudent(EducationStudent $educationStudent): self
  734. {
  735. if (!$this->educationStudent->contains($educationStudent)) {
  736. $this->educationStudent[] = $educationStudent;
  737. $educationStudent->setAccess($this);
  738. }
  739. return $this;
  740. }
  741. public function removeEducationStudent(EducationStudent $educationStudent): self
  742. {
  743. if ($this->educationStudent->removeElement($educationStudent)) {
  744. // set the owning side to null (unless already changed)
  745. if ($educationStudent->getAccess() === $this) {
  746. $educationStudent->setAccess(null);
  747. }
  748. }
  749. return $this;
  750. }
  751. /**
  752. * @return Collection<int, EducationStudent>
  753. */
  754. public function getEducationStudentByTeacher(): Collection
  755. {
  756. return $this->educationStudentByTeacher;
  757. }
  758. public function addEducationStudentByTeacher(EducationStudent $educationStudentByTeacher): self
  759. {
  760. if (!$this->educationStudentByTeacher->contains($educationStudentByTeacher)) {
  761. $this->educationStudentByTeacher[] = $educationStudentByTeacher;
  762. $educationStudentByTeacher->addTeacher($this);
  763. }
  764. return $this;
  765. }
  766. public function removeEducationStudentByTeacher(EducationStudent $educationStudentByTeacher): self
  767. {
  768. if ($this->educationStudentByTeacher->removeElement($educationStudentByTeacher)) {
  769. $educationStudentByTeacher->removeTeacher($this);
  770. }
  771. return $this;
  772. }
  773. /**
  774. * @return Collection<int, EducationTeacher>
  775. */
  776. public function getEducationTeachers(): Collection
  777. {
  778. return $this->educationTeachers;
  779. }
  780. public function addEducationTeacher(EducationTeacher $educationTeacher): self
  781. {
  782. if (!$this->educationTeachers->contains($educationTeacher)) {
  783. $this->educationTeachers[] = $educationTeacher;
  784. $educationTeacher->setTeacher($this);
  785. }
  786. return $this;
  787. }
  788. public function removeEducationTeacher(EducationTeacher $educationTeacher): self
  789. {
  790. if ($this->educationTeachers->removeElement($educationTeacher)) {
  791. // set the owning side to null (unless already changed)
  792. if ($educationTeacher->getTeacher() === $this) {
  793. $educationTeacher->setTeacher(null);
  794. }
  795. }
  796. return $this;
  797. }
  798. /**
  799. * @return Collection<int, PersonHoliday>
  800. */
  801. public function getHolidays(): Collection
  802. {
  803. return $this->holidays;
  804. }
  805. public function addHoliday(PersonHoliday $holiday): self
  806. {
  807. if (!$this->holidays->contains($holiday)) {
  808. $this->holidays[] = $holiday;
  809. $holiday->setAccess($this);
  810. }
  811. return $this;
  812. }
  813. public function removeHoliday(PersonHoliday $holiday): self
  814. {
  815. if ($this->holidays->removeElement($holiday)) {
  816. // set the owning side to null (unless already changed)
  817. if ($holiday->getAccess() === $this) {
  818. $holiday->setAccess(null);
  819. }
  820. }
  821. return $this;
  822. }
  823. /**
  824. * @return Collection<int, Course>
  825. */
  826. public function getCourses(): Collection
  827. {
  828. return $this->courses;
  829. }
  830. public function addCourse(Course $course): self
  831. {
  832. if (!$this->courses->contains($course)) {
  833. $this->courses[] = $course;
  834. $course->addStudent($this);
  835. }
  836. return $this;
  837. }
  838. public function removeCourse(Course $course): self
  839. {
  840. if ($this->courses->removeElement($course)) {
  841. $course->removeStudent($this);
  842. }
  843. return $this;
  844. }
  845. /**
  846. * @return Collection<int, Course>
  847. */
  848. public function getPracticalCourses(): Collection
  849. {
  850. return $this->practicalCourses;
  851. }
  852. public function addPracticalCourse(Course $practicalCourse): self
  853. {
  854. if (!$this->practicalCourses->contains($practicalCourse)) {
  855. $this->practicalCourses[] = $practicalCourse;
  856. $practicalCourse->addOrganizer($this);
  857. }
  858. return $this;
  859. }
  860. public function removePracticalCourse(Course $practicalCourse): self
  861. {
  862. if ($this->practicalCourses->removeElement($practicalCourse)) {
  863. $practicalCourse->removeOrganizer($this);
  864. }
  865. return $this;
  866. }
  867. public function getAccessFamily(): ?AccessFamily
  868. {
  869. return $this->accessFamily;
  870. }
  871. public function setAccessFamily(?AccessFamily $accessFamily): self
  872. {
  873. $this->accessFamily = $accessFamily;
  874. return $this;
  875. }
  876. /**
  877. * @return Collection<int, EducationalProjectPayer>
  878. */
  879. public function getBillingEducationalProjectPayers(): Collection
  880. {
  881. return $this->billingEducationalProjectPayers;
  882. }
  883. public function addBillingEducationalProjectPayer(EducationalProjectPayer $billingEducationalProjectPayer): self
  884. {
  885. if (!$this->billingEducationalProjectPayers->contains($billingEducationalProjectPayer)) {
  886. $this->billingEducationalProjectPayers[] = $billingEducationalProjectPayer;
  887. $billingEducationalProjectPayer->setEducationalProjectPayer($this);
  888. }
  889. return $this;
  890. }
  891. public function removeBillingEducationalProjectPayer(EducationalProjectPayer $billingEducationalProjectPayer): self
  892. {
  893. if ($this->billingEducationalProjectPayers->removeElement($billingEducationalProjectPayer)) {
  894. // set the owning side to null (unless already changed)
  895. if ($billingEducationalProjectPayer->getEducationalProjectPayer() === $this) {
  896. $billingEducationalProjectPayer->setEducationalProjectPayer(null);
  897. }
  898. }
  899. return $this;
  900. }
  901. /**
  902. * @return Collection<int, Bill>
  903. */
  904. public function getBills(): Collection
  905. {
  906. return $this->bills;
  907. }
  908. public function addBill(Bill $bill): self
  909. {
  910. if (!$this->bills->contains($bill)) {
  911. $this->bills[] = $bill;
  912. $bill->setAccess($this);
  913. }
  914. return $this;
  915. }
  916. public function removeBill(Bill $bill): self
  917. {
  918. if ($this->bills->removeElement($bill)) {
  919. // set the owning side to null (unless already changed)
  920. if ($bill->getAccess() === $this) {
  921. $bill->setAccess(null);
  922. }
  923. }
  924. return $this;
  925. }
  926. /**
  927. * @return Collection<int, BillLine>
  928. */
  929. public function getBillLines(): Collection
  930. {
  931. return $this->billLines;
  932. }
  933. public function addBillLine(BillLine $billLine): self
  934. {
  935. if (!$this->billLines->contains($billLine)) {
  936. $this->billLines[] = $billLine;
  937. $billLine->setAccess($this);
  938. }
  939. return $this;
  940. }
  941. public function removeBillLine(BillLine $billLine): self
  942. {
  943. if ($this->billLines->removeElement($billLine)) {
  944. // set the owning side to null (unless already changed)
  945. if ($billLine->getAccess() === $this) {
  946. $billLine->setAccess(null);
  947. }
  948. }
  949. return $this;
  950. }
  951. /**
  952. * @return Collection<int, BillCredit>
  953. */
  954. public function getBillCredits(): Collection
  955. {
  956. return $this->billCredits;
  957. }
  958. public function addBillCredit(BillCredit $billCredit): self
  959. {
  960. if (!$this->billCredits->contains($billCredit)) {
  961. $this->billCredits[] = $billCredit;
  962. $billCredit->setAccess($this);
  963. }
  964. return $this;
  965. }
  966. public function removeBillCredit(BillCredit $billCredit): self
  967. {
  968. if ($this->billCredits->removeElement($billCredit)) {
  969. // set the owning side to null (unless already changed)
  970. if ($billCredit->getAccess() === $this) {
  971. $billCredit->setAccess(null);
  972. }
  973. }
  974. return $this;
  975. }
  976. /**
  977. * @return Collection<int, EducationalProject>
  978. */
  979. public function getSilentPartners(): Collection
  980. {
  981. return $this->silentPartners;
  982. }
  983. public function addSilentPartner(EducationalProject $silentPartner): self
  984. {
  985. if (!$this->silentPartners->contains($silentPartner)) {
  986. $this->silentPartners[] = $silentPartner;
  987. $silentPartner->setSilentPartner($this);
  988. }
  989. return $this;
  990. }
  991. public function removeSilentPartner(EducationalProject $silentPartner): self
  992. {
  993. if ($this->silentPartners->removeElement($silentPartner)) {
  994. // set the owning side to null (unless already changed)
  995. if ($silentPartner->getSilentPartner() === $this) {
  996. $silentPartner->setSilentPartner(null);
  997. }
  998. }
  999. return $this;
  1000. }
  1001. /**
  1002. * @return Collection<int, EducationalProject>
  1003. */
  1004. public function getOperationalPartners(): Collection
  1005. {
  1006. return $this->operationalPartners;
  1007. }
  1008. public function addOperationalPartner(EducationalProject $operationalPartner): self
  1009. {
  1010. if (!$this->operationalPartners->contains($operationalPartner)) {
  1011. $this->operationalPartners[] = $operationalPartner;
  1012. $operationalPartner->setOperationalPartner($this);
  1013. }
  1014. return $this;
  1015. }
  1016. public function removeOperationalPartner(EducationalProject $operationalPartner): self
  1017. {
  1018. if ($this->operationalPartners->removeElement($operationalPartner)) {
  1019. // set the owning side to null (unless already changed)
  1020. if ($operationalPartner->getOperationalPartner() === $this) {
  1021. $operationalPartner->setOperationalPartner(null);
  1022. }
  1023. }
  1024. return $this;
  1025. }
  1026. /**
  1027. * @return Collection<int, EventUser>
  1028. */
  1029. public function getEventUsers(): Collection
  1030. {
  1031. return $this->eventUsers;
  1032. }
  1033. public function addEventUser(EventUser $eventUser): self
  1034. {
  1035. if (!$this->eventUsers->contains($eventUser)) {
  1036. $this->eventUsers[] = $eventUser;
  1037. $eventUser->setGuest($this);
  1038. }
  1039. return $this;
  1040. }
  1041. public function removeEventUser(EventUser $eventUser): self
  1042. {
  1043. if ($this->eventUsers->removeElement($eventUser)) {
  1044. // set the owning side to null (unless already changed)
  1045. if ($eventUser->getGuest() === $this) {
  1046. $eventUser->setGuest(null);
  1047. }
  1048. }
  1049. return $this;
  1050. }
  1051. /**
  1052. * @return Collection<int, ExamenConvocation>
  1053. */
  1054. public function getExamenConvocations(): Collection
  1055. {
  1056. return $this->examenConvocations;
  1057. }
  1058. public function addExamenConvocation(ExamenConvocation $examenConvocation): self
  1059. {
  1060. if (!$this->examenConvocations->contains($examenConvocation)) {
  1061. $this->examenConvocations[] = $examenConvocation;
  1062. $examenConvocation->setStudent($this);
  1063. }
  1064. return $this;
  1065. }
  1066. public function removeExamenConvocation(ExamenConvocation $examenConvocation): self
  1067. {
  1068. if ($this->examenConvocations->removeElement($examenConvocation)) {
  1069. // set the owning side to null (unless already changed)
  1070. if ($examenConvocation->getStudent() === $this) {
  1071. $examenConvocation->setStudent(null);
  1072. }
  1073. }
  1074. return $this;
  1075. }
  1076. /**
  1077. * @return Collection<int, EquipmentRepair>
  1078. */
  1079. public function getEquipmentRepairProviders(): Collection
  1080. {
  1081. return $this->equipmentRepairProviders;
  1082. }
  1083. public function addEquipmentRepairProvider(EquipmentRepair $equipmentRepairProvider): self
  1084. {
  1085. if (!$this->equipmentRepairProviders->contains($equipmentRepairProvider)) {
  1086. $this->equipmentRepairProviders[] = $equipmentRepairProvider;
  1087. $equipmentRepairProvider->setProvider($this);
  1088. }
  1089. return $this;
  1090. }
  1091. public function removeEquipmentRepairProvider(EquipmentRepair $equipmentRepairProvider): self
  1092. {
  1093. if ($this->equipmentRepairProviders->removeElement($equipmentRepairProvider)) {
  1094. // set the owning side to null (unless already changed)
  1095. if ($equipmentRepairProvider->getProvider() === $this) {
  1096. $equipmentRepairProvider->setProvider(null);
  1097. }
  1098. }
  1099. return $this;
  1100. }
  1101. /**
  1102. * @return Collection<int, Attendance>
  1103. */
  1104. public function getAttendances(): Collection
  1105. {
  1106. return $this->attendances;
  1107. }
  1108. public function addAttendance(Attendance $attendance): self
  1109. {
  1110. if (!$this->attendances->contains($attendance)) {
  1111. $this->attendances[] = $attendance;
  1112. $attendance->setAccess($this);
  1113. }
  1114. return $this;
  1115. }
  1116. public function removeAttendance(Attendance $attendance): self
  1117. {
  1118. if ($this->attendances->removeElement($attendance)) {
  1119. // set the owning side to null (unless already changed)
  1120. if ($attendance->getAccess() === $this) {
  1121. $attendance->setAccess(null);
  1122. }
  1123. }
  1124. return $this;
  1125. }
  1126. /**
  1127. * @return Collection<int, AttendanceBooking>
  1128. */
  1129. public function getAttendanceBookings(): Collection
  1130. {
  1131. return $this->attendanceBookings;
  1132. }
  1133. public function addAttendanceBooking(AttendanceBooking $attendanceBooking): self
  1134. {
  1135. if (!$this->attendanceBookings->contains($attendanceBooking)) {
  1136. $this->attendanceBookings[] = $attendanceBooking;
  1137. $attendanceBooking->setAccess($this);
  1138. }
  1139. return $this;
  1140. }
  1141. public function removeAttendanceBooking(AttendanceBooking $attendanceBooking): self
  1142. {
  1143. if ($this->attendanceBookings->removeElement($attendanceBooking)) {
  1144. // set the owning side to null (unless already changed)
  1145. if ($attendanceBooking->getAccess() === $this) {
  1146. $attendanceBooking->setAccess(null);
  1147. }
  1148. }
  1149. return $this;
  1150. }
  1151. /**
  1152. * @return Collection<int, Attendance>
  1153. */
  1154. public function getAttendanceReplacements(): Collection
  1155. {
  1156. return $this->attendanceReplacements;
  1157. }
  1158. public function addAttendanceReplacement(Attendance $attendanceReplacement): self
  1159. {
  1160. if (!$this->attendanceReplacements->contains($attendanceReplacement)) {
  1161. $this->attendanceReplacements[] = $attendanceReplacement;
  1162. $attendanceReplacement->setReplacement($this);
  1163. }
  1164. return $this;
  1165. }
  1166. public function removeAttendanceReplacement(Attendance $attendanceReplacement): self
  1167. {
  1168. if ($this->attendanceReplacements->removeElement($attendanceReplacement)) {
  1169. // set the owning side to null (unless already changed)
  1170. if ($attendanceReplacement->getReplacement() === $this) {
  1171. $attendanceReplacement->setReplacement(null);
  1172. }
  1173. }
  1174. return $this;
  1175. }
  1176. /**
  1177. * @return Collection<int, RoomRepair>
  1178. */
  1179. public function getRoomRepairProviders(): Collection
  1180. {
  1181. return $this->roomRepairProviders;
  1182. }
  1183. public function addRoomRepairProvider(RoomRepair $roomRepairProvider): self
  1184. {
  1185. if (!$this->roomRepairProviders->contains($roomRepairProvider)) {
  1186. $this->roomRepairProviders[] = $roomRepairProvider;
  1187. $roomRepairProvider->setProvider($this);
  1188. }
  1189. return $this;
  1190. }
  1191. public function removeRoomRepairProvider(RoomRepair $roomRepairProvider): self
  1192. {
  1193. if ($this->roomRepairProviders->removeElement($roomRepairProvider)) {
  1194. // set the owning side to null (unless already changed)
  1195. if ($roomRepairProvider->getProvider() === $this) {
  1196. $roomRepairProvider->setProvider(null);
  1197. }
  1198. }
  1199. return $this;
  1200. }
  1201. /**
  1202. * @return Collection<int, PlaceRepair>
  1203. */
  1204. public function getPlaceRepairProviders(): Collection
  1205. {
  1206. return $this->placeRepairProviders;
  1207. }
  1208. public function addPlaceRepairProvider(PlaceRepair $placeRepairProvider): self
  1209. {
  1210. if (!$this->placeRepairProviders->contains($placeRepairProvider)) {
  1211. $this->placeRepairProviders[] = $placeRepairProvider;
  1212. $placeRepairProvider->setProvider($this);
  1213. }
  1214. return $this;
  1215. }
  1216. public function removePlaceRepairProvider(PlaceRepair $placeRepairProvider): self
  1217. {
  1218. if ($this->placeRepairProviders->removeElement($placeRepairProvider)) {
  1219. // set the owning side to null (unless already changed)
  1220. if ($placeRepairProvider->getProvider() === $this) {
  1221. $placeRepairProvider->setProvider(null);
  1222. }
  1223. }
  1224. return $this;
  1225. }
  1226. /**
  1227. * @return Collection<int, Jury>
  1228. */
  1229. public function getJuryMembers(): Collection
  1230. {
  1231. return $this->juryMembers;
  1232. }
  1233. public function addJuryMember(Jury $juryMember): self
  1234. {
  1235. if (!$this->juryMembers->contains($juryMember)) {
  1236. $this->juryMembers[] = $juryMember;
  1237. $juryMember->addMember($this);
  1238. }
  1239. return $this;
  1240. }
  1241. public function removeJuryMember(Jury $juryMember): self
  1242. {
  1243. if ($this->juryMembers->removeElement($juryMember)) {
  1244. $juryMember->removeMember($this);
  1245. }
  1246. return $this;
  1247. }
  1248. /**
  1249. * @return Collection<int, Organization>
  1250. */
  1251. public function getOrganizationContacts(): Collection
  1252. {
  1253. return $this->organizationContacts;
  1254. }
  1255. public function addOrganizationContact(Organization $organizationContact): self
  1256. {
  1257. if (!$this->organizationContacts->contains($organizationContact)) {
  1258. $this->organizationContacts[] = $organizationContact;
  1259. $organizationContact->setContactPerson($this);
  1260. }
  1261. return $this;
  1262. }
  1263. public function removeOrganizationContact(Organization $organizationContact): self
  1264. {
  1265. if ($this->organizationContacts->removeElement($organizationContact)) {
  1266. // set the owning side to null (unless already changed)
  1267. if ($organizationContact->getContactPerson() === $this) {
  1268. $organizationContact->setContactPerson(null);
  1269. }
  1270. }
  1271. return $this;
  1272. }
  1273. /**
  1274. * @return Collection<int, CommissionMember>
  1275. */
  1276. public function getCommissionMembers(): Collection
  1277. {
  1278. return $this->commissionMembers;
  1279. }
  1280. public function addCommissionMember(CommissionMember $commissionMember): self
  1281. {
  1282. if (!$this->commissionMembers->contains($commissionMember)) {
  1283. $this->commissionMembers[] = $commissionMember;
  1284. $commissionMember->setMember($this);
  1285. }
  1286. return $this;
  1287. }
  1288. public function removeCommissionMember(CommissionMember $commissionMember): self
  1289. {
  1290. if ($this->commissionMembers->removeElement($commissionMember)) {
  1291. // set the owning side to null (unless already changed)
  1292. if ($commissionMember->getMember() === $this) {
  1293. $commissionMember->setMember(null);
  1294. }
  1295. }
  1296. return $this;
  1297. }
  1298. /**
  1299. * @return Collection<int, Equipment>
  1300. */
  1301. public function getEquipmentSuppliers(): Collection
  1302. {
  1303. return $this->equipmentSuppliers;
  1304. }
  1305. public function addEquipmentSupplier(Equipment $equipmentSupplier): self
  1306. {
  1307. if (!$this->equipmentSuppliers->contains($equipmentSupplier)) {
  1308. $this->equipmentSuppliers[] = $equipmentSupplier;
  1309. $equipmentSupplier->setSupplier($this);
  1310. }
  1311. return $this;
  1312. }
  1313. public function removeEquipmentSupplier(Equipment $equipmentSupplier): self
  1314. {
  1315. if ($this->equipmentSuppliers->removeElement($equipmentSupplier)) {
  1316. // set the owning side to null (unless already changed)
  1317. if ($equipmentSupplier->getSupplier() === $this) {
  1318. $equipmentSupplier->setSupplier(null);
  1319. }
  1320. }
  1321. return $this;
  1322. }
  1323. /**
  1324. * @return Collection<int, Equipment>
  1325. */
  1326. public function getEquipmentControlManagers(): Collection
  1327. {
  1328. return $this->equipmentControlManagers;
  1329. }
  1330. public function addEquipmentControlManager(Equipment $equipmentControlManager): self
  1331. {
  1332. if (!$this->equipmentControlManagers->contains($equipmentControlManager)) {
  1333. $this->equipmentControlManagers[] = $equipmentControlManager;
  1334. $equipmentControlManager->setControlManager($this);
  1335. }
  1336. return $this;
  1337. }
  1338. public function removeEquipmentControlManager(Equipment $equipmentControlManager): self
  1339. {
  1340. if ($this->equipmentControlManagers->removeElement($equipmentControlManager)) {
  1341. // set the owning side to null (unless already changed)
  1342. if ($equipmentControlManager->getControlManager() === $this) {
  1343. $equipmentControlManager->setControlManager(null);
  1344. }
  1345. }
  1346. return $this;
  1347. }
  1348. /**
  1349. * @return Collection<int, Equipment>
  1350. */
  1351. public function getEquipmentEditors(): Collection
  1352. {
  1353. return $this->equipmentEditors;
  1354. }
  1355. public function addEquipmentEditor(Equipment $equipmentEditor): self
  1356. {
  1357. if (!$this->equipmentEditors->contains($equipmentEditor)) {
  1358. $this->equipmentEditors[] = $equipmentEditor;
  1359. $equipmentEditor->setEditor($this);
  1360. }
  1361. return $this;
  1362. }
  1363. public function removeEquipmentEditor(Equipment $equipmentEditor): self
  1364. {
  1365. if ($this->equipmentEditors->removeElement($equipmentEditor)) {
  1366. // set the owning side to null (unless already changed)
  1367. if ($equipmentEditor->getEditor() === $this) {
  1368. $equipmentEditor->setEditor(null);
  1369. }
  1370. }
  1371. return $this;
  1372. }
  1373. /**
  1374. * @return Collection<int, EquipmentLoan>
  1375. */
  1376. public function getEquipmentLoans(): Collection
  1377. {
  1378. return $this->equipmentLoans;
  1379. }
  1380. public function addEquipmentLoan(EquipmentLoan $equipmentLoan): self
  1381. {
  1382. if (!$this->equipmentLoans->contains($equipmentLoan)) {
  1383. $this->equipmentLoans[] = $equipmentLoan;
  1384. $equipmentLoan->setBorrower($this);
  1385. }
  1386. return $this;
  1387. }
  1388. public function removeEquipmentLoan(EquipmentLoan $equipmentLoan): self
  1389. {
  1390. if ($this->equipmentLoans->removeElement($equipmentLoan)) {
  1391. // set the owning side to null (unless already changed)
  1392. if ($equipmentLoan->getBorrower() === $this) {
  1393. $equipmentLoan->setBorrower(null);
  1394. }
  1395. }
  1396. return $this;
  1397. }
  1398. /**
  1399. * @return Collection<int, Equipment>
  1400. */
  1401. public function getEquipments(): Collection
  1402. {
  1403. return $this->equipments;
  1404. }
  1405. public function addEquipment(Equipment $equipment): self
  1406. {
  1407. if (!$this->equipments->contains($equipment)) {
  1408. $this->equipments[] = $equipment;
  1409. $equipment->setAccess($this);
  1410. }
  1411. return $this;
  1412. }
  1413. public function removeEquipment(Equipment $equipment): self
  1414. {
  1415. if ($this->equipments->removeElement($equipment)) {
  1416. // set the owning side to null (unless already changed)
  1417. if ($equipment->getAccess() === $this) {
  1418. $equipment->setAccess(null);
  1419. }
  1420. }
  1421. return $this;
  1422. }
  1423. /**
  1424. * @return Collection<int, AccessFictionalIntangible>
  1425. */
  1426. public function getAccessFictionalIntangibles(): Collection
  1427. {
  1428. return $this->accessFictionalIntangibles;
  1429. }
  1430. public function addAccessFictionalIntangible(AccessFictionalIntangible $accessFictionalIntangible): self
  1431. {
  1432. if (!$this->accessFictionalIntangibles->contains($accessFictionalIntangible)) {
  1433. $this->accessFictionalIntangibles[] = $accessFictionalIntangible;
  1434. $accessFictionalIntangible->setAccess($this);
  1435. }
  1436. return $this;
  1437. }
  1438. public function removeAccessFictionalIntangible(AccessFictionalIntangible $accessFictionalIntangible): self
  1439. {
  1440. if ($this->accessFictionalIntangibles->removeElement($accessFictionalIntangible)) {
  1441. // set the owning side to null (unless already changed)
  1442. if ($accessFictionalIntangible->getAccess() === $this) {
  1443. $accessFictionalIntangible->setAccess(null);
  1444. }
  1445. }
  1446. return $this;
  1447. }
  1448. /**
  1449. * @return Collection<int, Donor>
  1450. */
  1451. public function getDonors(): Collection
  1452. {
  1453. return $this->donors;
  1454. }
  1455. public function addDonor(Donor $donor): self
  1456. {
  1457. if (!$this->donors->contains($donor)) {
  1458. $this->donors[] = $donor;
  1459. $donor->setAccess($this);
  1460. }
  1461. return $this;
  1462. }
  1463. public function removeDonor(Donor $donor): self
  1464. {
  1465. if ($this->donors->removeElement($donor)) {
  1466. // set the owning side to null (unless already changed)
  1467. if ($donor->getAccess() === $this) {
  1468. $donor->setAccess(null);
  1469. }
  1470. }
  1471. return $this;
  1472. }
  1473. /**
  1474. * @return Collection<int, Medal>
  1475. */
  1476. public function getMedals(): Collection
  1477. {
  1478. return $this->medals;
  1479. }
  1480. public function addMedal(Medal $medal): self
  1481. {
  1482. if (!$this->medals->contains($medal)) {
  1483. $this->medals[] = $medal;
  1484. $medal->setAccess($this);
  1485. }
  1486. return $this;
  1487. }
  1488. public function removeMedal(Medal $medal): self
  1489. {
  1490. if ($this->medals->removeElement($medal)) {
  1491. // set the owning side to null (unless already changed)
  1492. if ($medal->getAccess() === $this) {
  1493. $medal->setAccess(null);
  1494. }
  1495. }
  1496. return $this;
  1497. }
  1498. /**
  1499. * @return Collection<int, OrganizationResponsability>
  1500. */
  1501. public function getOrganizationResponsabilities(): Collection
  1502. {
  1503. return $this->organizationResponsabilities;
  1504. }
  1505. public function addOrganizationResponsability(OrganizationResponsability $organizationResponsability): self
  1506. {
  1507. if (!$this->organizationResponsabilities->contains($organizationResponsability)) {
  1508. $this->organizationResponsabilities[] = $organizationResponsability;
  1509. $organizationResponsability->setAccess($this);
  1510. }
  1511. return $this;
  1512. }
  1513. public function removeOrganizationResponsability(OrganizationResponsability $organizationResponsability): self
  1514. {
  1515. if ($this->organizationResponsabilities->removeElement($organizationResponsability)) {
  1516. // set the owning side to null (unless already changed)
  1517. if ($organizationResponsability->getAccess() === $this) {
  1518. $organizationResponsability->setAccess(null);
  1519. }
  1520. }
  1521. return $this;
  1522. }
  1523. /**
  1524. * @return Collection<int, AccessWish>
  1525. */
  1526. public function getAccessWishes(): Collection
  1527. {
  1528. return $this->accessWishes;
  1529. }
  1530. public function addAccessWish(AccessWish $accessWish): self
  1531. {
  1532. if (!$this->accessWishes->contains($accessWish)) {
  1533. $this->accessWishes[] = $accessWish;
  1534. $accessWish->setAccessOriginal($this);
  1535. }
  1536. return $this;
  1537. }
  1538. public function removeAccessWish(AccessWish $accessWish): self
  1539. {
  1540. if ($this->accessWishes->removeElement($accessWish)) {
  1541. // set the owning side to null (unless already changed)
  1542. if ($accessWish->getAccessOriginal() === $this) {
  1543. $accessWish->setAccessOriginal(null);
  1544. }
  1545. }
  1546. return $this;
  1547. }
  1548. /**
  1549. * @return Collection<int, WorkByUser>
  1550. */
  1551. public function getWorkByUsers(): Collection
  1552. {
  1553. return $this->workByUsers;
  1554. }
  1555. public function addWorkByUser(WorkByUser $workByUser): self
  1556. {
  1557. if (!$this->workByUsers->contains($workByUser)) {
  1558. $this->workByUsers[] = $workByUser;
  1559. $workByUser->setStudent($this);
  1560. }
  1561. return $this;
  1562. }
  1563. public function removeWorkByUser(WorkByUser $workByUser): self
  1564. {
  1565. if ($this->workByUsers->removeElement($workByUser)) {
  1566. // set the owning side to null (unless already changed)
  1567. if ($workByUser->getStudent() === $this) {
  1568. $workByUser->setStudent(null);
  1569. }
  1570. }
  1571. return $this;
  1572. }
  1573. /**
  1574. * @return Collection<int, Tagg>
  1575. */
  1576. public function getTags(): Collection
  1577. {
  1578. return $this->tags;
  1579. }
  1580. public function addTag(Tagg $tag): self
  1581. {
  1582. if (!$this->tags->contains($tag)) {
  1583. $this->tags[] = $tag;
  1584. }
  1585. return $this;
  1586. }
  1587. public function removeTag(Tagg $tag): self
  1588. {
  1589. $this->tags->removeElement($tag);
  1590. return $this;
  1591. }
  1592. /**
  1593. * @return Collection<int, Event>
  1594. */
  1595. public function getEventOrganizers(): Collection
  1596. {
  1597. return $this->eventOrganizers;
  1598. }
  1599. public function addEventOrganizer(Event $eventOrganizer): self
  1600. {
  1601. if (!$this->eventOrganizers->contains($eventOrganizer)) {
  1602. $this->eventOrganizers[] = $eventOrganizer;
  1603. $eventOrganizer->addOrganizer($this);
  1604. }
  1605. return $this;
  1606. }
  1607. public function removeEventOrganizer(Event $eventOrganizer): self
  1608. {
  1609. if ($this->eventOrganizers->removeElement($eventOrganizer)) {
  1610. $eventOrganizer->removeOrganizer($this);
  1611. }
  1612. return $this;
  1613. }
  1614. /**
  1615. * @return Collection<int, EducationalProject>
  1616. */
  1617. public function getEducationalProjectOrganizers(): Collection
  1618. {
  1619. return $this->educationalProjectOrganizers;
  1620. }
  1621. public function addEducationalProjectOrganizer(EducationalProject $educationalProjectOrganizer): self
  1622. {
  1623. if (!$this->educationalProjectOrganizers->contains($educationalProjectOrganizer)) {
  1624. $this->educationalProjectOrganizers[] = $educationalProjectOrganizer;
  1625. $educationalProjectOrganizer->addOrganizer($this);
  1626. }
  1627. return $this;
  1628. }
  1629. public function removeEducationalProjectOrganizer(EducationalProject $educationalProjectOrganizer): self
  1630. {
  1631. if ($this->educationalProjectOrganizers->removeElement($educationalProjectOrganizer)) {
  1632. $educationalProjectOrganizer->removeOrganizer($this);
  1633. }
  1634. return $this;
  1635. }
  1636. /**
  1637. * @return Collection<int, Email>
  1638. */
  1639. public function getEmails(): Collection
  1640. {
  1641. return $this->emails;
  1642. }
  1643. public function addEmail(Email $email): self
  1644. {
  1645. if (!$this->emails->contains($email)) {
  1646. $this->emails[] = $email;
  1647. $email->setAuthor($this);
  1648. }
  1649. return $this;
  1650. }
  1651. public function removeEmail(Email $email): self
  1652. {
  1653. if ($this->emails->removeElement($email)) {
  1654. // set the owning side to null (unless already changed)
  1655. if ($email->getAuthor() === $this) {
  1656. $email->setAuthor(null);
  1657. }
  1658. }
  1659. return $this;
  1660. }
  1661. /**
  1662. * @return Collection<int, Mail>
  1663. */
  1664. public function getMails(): Collection
  1665. {
  1666. return $this->mails;
  1667. }
  1668. public function addMail(Mail $mail): self
  1669. {
  1670. if (!$this->mails->contains($mail)) {
  1671. $this->mails[] = $mail;
  1672. $mail->setAuthor($this);
  1673. }
  1674. return $this;
  1675. }
  1676. public function removeMail(Mail $mail): self
  1677. {
  1678. if ($this->mails->removeElement($mail)) {
  1679. // set the owning side to null (unless already changed)
  1680. if ($mail->getAuthor() === $this) {
  1681. $mail->setAuthor(null);
  1682. }
  1683. }
  1684. return $this;
  1685. }
  1686. /**
  1687. * @return Collection<int, Sms>
  1688. */
  1689. public function getSms(): Collection
  1690. {
  1691. return $this->sms;
  1692. }
  1693. public function addSms(Sms $sms): self
  1694. {
  1695. if (!$this->sms->contains($sms)) {
  1696. $this->sms[] = $sms;
  1697. $sms->setAuthor($this);
  1698. }
  1699. return $this;
  1700. }
  1701. public function removeSms(Sms $sms): self
  1702. {
  1703. if ($this->sms->removeElement($sms)) {
  1704. // set the owning side to null (unless already changed)
  1705. if ($sms->getAuthor() === $this) {
  1706. $sms->setAuthor(null);
  1707. }
  1708. }
  1709. return $this;
  1710. }
  1711. public function getAccessBilling(): ?AccessBilling
  1712. {
  1713. return $this->accessBilling;
  1714. }
  1715. public function setAccessBilling(?AccessBilling $accessBilling): self
  1716. {
  1717. // unset the owning side of the relation if necessary
  1718. if ($accessBilling === null && $this->accessBilling !== null) {
  1719. $this->accessBilling->setAccess(null);
  1720. }
  1721. // set the owning side of the relation if necessary
  1722. if ($accessBilling !== null && $accessBilling->getAccess() !== $this) {
  1723. $accessBilling->setAccess($this);
  1724. }
  1725. $this->accessBilling = $accessBilling;
  1726. return $this;
  1727. }
  1728. }