Access.php 61 KB

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