Access.php 64 KB

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