Access.php 61 KB

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