Access.php 78 KB

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