Access.php 61 KB

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