Access.php 61 KB

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