Access.php 76 KB

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