Access.php 64 KB

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