Access.php 61 KB

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