src/Entity/User.php line 21

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\UserRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Serializable;
  8. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  9. use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface;
  10. use Symfony\Component\Security\Core\User\UserInterface;
  11. use JMS\Serializer\Annotation as Serializer;
  12. /**
  13. * @ORM\Entity(repositoryClass=UserRepository::class)
  14. * @ORM\Table(name="`user`")
  15. * @Serializer\ExclusionPolicy("ALL")
  16. */
  17. #[UniqueEntity(fields: ['email'], message: 'message="Ce compte existe déjà')]
  18. class User implements UserInterface, PasswordAuthenticatedUserInterface, Serializable
  19. {
  20. /**
  21. * @ORM\Id
  22. * @ORM\GeneratedValue
  23. * @ORM\Column(type="integer")
  24. * @Serializer\Expose
  25. * @Serializer\Groups({"user_profile", "edit_profile", "testimony", "ligth_list", "edit_visitor_profile", "live_details"})
  26. */
  27. private $id;
  28. /**
  29. * @ORM\Column(type="string", length=180, unique=true)
  30. * @Serializer\Expose
  31. * @Serializer\Groups({"user_profile", "edit_profile", "testimony", "ligth_list", "edit_visitor_profile", "live_details"})
  32. */
  33. private $email;
  34. /**
  35. * @ORM\Column(type="json")
  36. */
  37. private $roles = [];
  38. /**
  39. * @var string The hashed password
  40. * @ORM\Column(type="string", nullable=true)
  41. */
  42. private $password;
  43. /**
  44. * @ORM\Column(type="datetime", nullable=true)
  45. */
  46. private $lastLoginAt;
  47. /**
  48. * @ORM\Column(type="datetime", nullable=true)
  49. */
  50. private $lastLogoutAt;
  51. /**
  52. * @ORM\OneToMany(targetEntity=UserOffice::class, mappedBy="user", cascade={"persist", "remove"}, fetch="EXTRA_LAZY")
  53. */
  54. private $userOffices;
  55. /**
  56. * @ORM\Column(type="text", nullable=true)
  57. * @Serializer\Expose
  58. * @Serializer\Groups({"user_profile"})
  59. */
  60. private $description;
  61. /**
  62. * @ORM\Column(type="string", length=255, nullable=true)
  63. * @Serializer\Expose
  64. * @Serializer\Groups({"user_profile", "edit_profile", "testimony", "historic", "ligth_list", "edit_visitor_profile", "live_details"})
  65. */
  66. private $lastname;
  67. /**
  68. * @ORM\Column(type="string", length=255, nullable=true)
  69. * @Serializer\Expose
  70. * @Serializer\Groups({"user_profile", "edit_profile", "testimony", "historic", "ligth_list", "edit_visitor_profile", "live_details"})
  71. */
  72. private $firstname;
  73. /**
  74. * @ORM\OneToMany(targetEntity=Experience::class, mappedBy="user", cascade={"persist", "remove"}, fetch="EXTRA_LAZY")
  75. * @Serializer\Expose
  76. * @Serializer\Groups({"user_profile"})
  77. */
  78. private $userExperiences;
  79. /**
  80. * @ORM\OneToMany(targetEntity=Course::class, mappedBy="publishedBy", fetch="EXTRA_LAZY")
  81. */
  82. private $courses;
  83. /**
  84. * @ORM\ManyToMany(targetEntity=Role::class, mappedBy="users")
  85. */
  86. private $userRoles;
  87. /**
  88. * @ORM\OneToMany(targetEntity=Enrollment::class, mappedBy="user", fetch="EXTRA_LAZY")
  89. */
  90. private $enrollments;
  91. /**
  92. * @ORM\ManyToOne(targetEntity=Country::class, inversedBy="users")
  93. * @Serializer\Expose
  94. * @Serializer\Groups({"edit_visitor_profile"})
  95. */
  96. private $country;
  97. /**
  98. * @ORM\Column(type="boolean", nullable=true)
  99. * @Serializer\Expose
  100. */
  101. private $isFirstConnexion = true;
  102. /**
  103. * @ORM\OneToMany(targetEntity=ModuleView::class, mappedBy="createdBy", fetch="EXTRA_LAZY")
  104. */
  105. private $moduleViews;
  106. /**
  107. * @ORM\OneToMany(targetEntity=ModuleLike::class, mappedBy="user", fetch="EXTRA_LAZY")
  108. */
  109. private $moduleLikes;
  110. /**
  111. * @ORM\OneToMany(targetEntity=Module::class, mappedBy="publishedBy", fetch="EXTRA_LAZY")
  112. */
  113. private $modulePublishers;
  114. /**
  115. * @ORM\OneToMany(targetEntity=UserQuizQuestion::class, mappedBy="user", fetch="EXTRA_LAZY")
  116. */
  117. private $userQuizQuestions;
  118. /**
  119. * @ORM\OneToMany(targetEntity=Quote::class, mappedBy="publishedBy", fetch="EXTRA_LAZY")
  120. */
  121. private $quotes;
  122. /**
  123. * @ORM\OneToMany(targetEntity=Director::class, mappedBy="publishedBy", fetch="EXTRA_LAZY")
  124. */
  125. private $directors;
  126. /**
  127. * @ORM\ManyToMany(targetEntity=Module::class, mappedBy="coaches")
  128. */
  129. private $modules;
  130. /**
  131. * @ORM\ManyToMany(targetEntity=Live::class, mappedBy="coaches")
  132. */
  133. private $lives;
  134. /**
  135. * @ORM\OneToMany(targetEntity=LiveParticipant::class, mappedBy="participant", fetch="EXTRA_LAZY")
  136. */
  137. private $liveParticipants;
  138. /**
  139. * @ORM\Column(type="string", length=255, nullable=true)
  140. */
  141. private $registrationNumber;
  142. /**
  143. * @ORM\Column(type="string", length=255, nullable=true)
  144. */
  145. private $hierarchicalLevel;
  146. /**
  147. * @ORM\OneToMany(targetEntity=ModuleComment::class, mappedBy="user", fetch="EXTRA_LAZY")
  148. */
  149. private $moduleComments;
  150. /**
  151. * @ORM\ManyToOne(targetEntity=SubsidiaryCompany::class, inversedBy="users")
  152. * @Serializer\Expose
  153. * @Serializer\Groups({"user_profile"})
  154. */
  155. private $subsidiaryCompany;
  156. /**
  157. * @ORM\ManyToOne(targetEntity=Job::class, inversedBy="users")
  158. */
  159. private $job;
  160. /**
  161. * @ORM\ManyToOne(targetEntity=Office::class, inversedBy="users")
  162. * @Serializer\Expose
  163. * @Serializer\Groups({"user_profile"})
  164. */
  165. private $office;
  166. /**
  167. * @ORM\ManyToOne(targetEntity=Contract::class, inversedBy="users")
  168. */
  169. private $contract;
  170. /**
  171. * @ORM\Column(type="string", length=255, nullable=true)
  172. * @Serializer\Expose
  173. * @Serializer\Groups({"user_profile", "edit_profile", "testimony", "live_details"})
  174. */
  175. private $phoneNumber;
  176. /**
  177. * @ORM\Column(type="string", length=255, nullable=true)
  178. */
  179. private $status;
  180. /**
  181. * @ORM\Column(type="boolean", nullable=true)
  182. */
  183. private $active = true;
  184. /**
  185. * @ORM\OneToOne(targetEntity=ImageManager::class, cascade={"persist", "remove"})
  186. * @Serializer\Expose
  187. * @Serializer\Groups({"user_profile", "live_details"})
  188. */
  189. private $photo;
  190. /**
  191. * @ORM\Column(type="string", length=255, nullable=true)
  192. */
  193. private $referent;
  194. /**
  195. * @ORM\Column(type="datetime", nullable=true)
  196. * @Serializer\Expose
  197. * @Serializer\Groups({"user_profile"})
  198. */
  199. private $entryDate;
  200. /**
  201. * @ORM\ManyToOne(targetEntity=User::class, inversedBy="responsibles")
  202. */
  203. private $responsible;
  204. /**
  205. * @ORM\OneToMany(targetEntity=User::class, mappedBy="responsible", fetch="EXTRA_LAZY")
  206. */
  207. private $responsibles;
  208. /**
  209. * @ORM\OneToMany(targetEntity=ProgramParticipation::class, mappedBy="createdBy", fetch="EXTRA_LAZY")
  210. */
  211. private $programParticipations;
  212. /**
  213. * @ORM\OneToMany(targetEntity=ModuleParticipation::class, mappedBy="createdBy", fetch="EXTRA_LAZY")
  214. */
  215. private $moduleParticipations;
  216. /**
  217. * @ORM\OneToMany(targetEntity=ModuleInscription::class, mappedBy="user", fetch="EXTRA_LAZY")
  218. */
  219. private $moduleInscriptions;
  220. /**
  221. * @ORM\Column(type="string", length=255, nullable=true)
  222. */
  223. private $activationCode;
  224. /**
  225. * @ORM\Column(type="datetime", nullable=true)
  226. */
  227. private $activationCodeExpiredAt;
  228. /**
  229. * @ORM\Column(type="string", length=255, nullable=true)
  230. */
  231. private $resetCode;
  232. /**
  233. * @ORM\Column(type="datetime", nullable=true)
  234. */
  235. private $resetCodeExpiredAt;
  236. /**
  237. * @ORM\Column(type="array", nullable=true)
  238. */
  239. private $deviceTokens = [];
  240. /**
  241. * @ORM\OneToMany(targetEntity=Discussion::class, mappedBy="createdBy", fetch="EXTRA_LAZY")
  242. */
  243. private $senderDiscussions;
  244. /**
  245. * @ORM\OneToMany(targetEntity=Discussion::class, mappedBy="receiver", fetch="EXTRA_LAZY")
  246. */
  247. private $receiverDiscussions;
  248. /**
  249. * @ORM\OneToMany(targetEntity=Message::class, mappedBy="createdBy", fetch="EXTRA_LAZY")
  250. */
  251. private $messages;
  252. /**
  253. * @ORM\Column(type="boolean")
  254. */
  255. private $isVerified = true;
  256. /**
  257. * @ORM\Column(type="string", length=255, nullable=true)
  258. */
  259. private $profileColor;
  260. /**
  261. * @ORM\ManyToMany(targetEntity=Program::class, mappedBy="users")
  262. */
  263. private $programs;
  264. /**
  265. * @ORM\OneToMany(targetEntity=UserModuleParticipation::class, mappedBy="createdBy", fetch="EXTRA_LAZY")
  266. */
  267. private $userModuleParticipations;
  268. /**
  269. * @ORM\Column(type="boolean", nullable=true)
  270. */
  271. private $isInternalAccount = false;
  272. /**
  273. * @ORM\Column(type="integer", nullable=true)
  274. */
  275. private $elapsedTime;
  276. /**
  277. * @ORM\OneToMany(targetEntity=Notification::class, mappedBy="receiver", fetch="EXTRA_LAZY")
  278. */
  279. private $notifications;
  280. /**
  281. * @ORM\OneToMany(targetEntity=NotificationReceiver::class, mappedBy="receiver", fetch="EXTRA_LAZY")
  282. */
  283. private $notificationReceivers;
  284. /**
  285. * @ORM\Column(type="datetime", nullable=true)
  286. */
  287. private $lastLoginNotifiedAt;
  288. /**
  289. * @ORM\OneToMany(targetEntity=Message::class, mappedBy="receiver", fetch="EXTRA_LAZY")
  290. */
  291. private $receiverMessages;
  292. public function __construct()
  293. {
  294. $this->userOffices = new ArrayCollection();
  295. $this->userExperiences = new ArrayCollection();
  296. $this->courses = new ArrayCollection();
  297. $this->userRoles = new ArrayCollection();
  298. $this->enrollments = new ArrayCollection();
  299. $this->moduleViews = new ArrayCollection();
  300. $this->moduleLikes = new ArrayCollection();
  301. $this->modulePublishers = new ArrayCollection();
  302. $this->userQuizQuestions = new ArrayCollection();
  303. $this->quotes = new ArrayCollection();
  304. $this->directors = new ArrayCollection();
  305. $this->modules = new ArrayCollection();
  306. $this->lives = new ArrayCollection();
  307. $this->liveParticipants = new ArrayCollection();
  308. $this->moduleComments = new ArrayCollection();
  309. $this->responsibles = new ArrayCollection();
  310. $this->programParticipations = new ArrayCollection();
  311. $this->moduleParticipations = new ArrayCollection();
  312. $this->moduleInscriptions = new ArrayCollection();
  313. $this->senderDiscussions = new ArrayCollection();
  314. $this->receiverDiscussions = new ArrayCollection();
  315. $this->messages = new ArrayCollection();
  316. $this->programs = new ArrayCollection();
  317. $this->userModuleParticipations = new ArrayCollection();
  318. $this->notifications = new ArrayCollection();
  319. $this->notificationReceivers = new ArrayCollection();
  320. $this->receiverMessages = new ArrayCollection();
  321. }
  322. public function getId(): ?int
  323. {
  324. return $this->id;
  325. }
  326. public function getEmail(): ?string
  327. {
  328. return $this->email;
  329. }
  330. public function setEmail(string $email): self
  331. {
  332. $this->email = $email;
  333. return $this;
  334. }
  335. /**
  336. * A visual identifier that represents this user.
  337. *
  338. * @see UserInterface
  339. */
  340. public function getUserIdentifier(): string
  341. {
  342. return (string) $this->email;
  343. }
  344. /**
  345. * @deprecated since Symfony 5.3, use getUserIdentifier instead
  346. */
  347. public function getUsername(): string
  348. {
  349. return (string) $this->email;
  350. }
  351. /**
  352. * @see UserInterface
  353. */
  354. public function getRoles(): array
  355. {
  356. $roles = $this->roles;
  357. // guarantee every user at least has ROLE_USER
  358. $roles[] = 'ROLE_USER';
  359. return array_unique($roles);
  360. }
  361. public function setRoles(array $roles): self
  362. {
  363. $this->roles = $roles;
  364. return $this;
  365. }
  366. /**
  367. * @see PasswordAuthenticatedUserInterface
  368. */
  369. public function getPassword(): ?string
  370. {
  371. return $this->password;
  372. }
  373. public function setPassword(?string $password): self
  374. {
  375. $this->password = $password;
  376. return $this;
  377. }
  378. /**
  379. * Returning a salt is only needed, if you are not using a modern
  380. * hashing algorithm (e.g. bcrypt or sodium) in your security.yaml.
  381. *
  382. * @see UserInterface
  383. */
  384. public function getSalt(): ?string
  385. {
  386. return null;
  387. }
  388. /**
  389. * @see UserInterface
  390. */
  391. public function eraseCredentials()
  392. {
  393. // If you store any temporary, sensitive data on the user, clear it here
  394. // $this->plainPassword = null;
  395. }
  396. public function getLastLoginAt(): ?\DateTimeInterface
  397. {
  398. return $this->lastLoginAt;
  399. }
  400. public function setLastLoginAt(?\DateTimeInterface $lastLoginAt): self
  401. {
  402. $this->lastLoginAt = $lastLoginAt;
  403. return $this;
  404. }
  405. public function getLastLogoutAt(): ?\DateTimeInterface
  406. {
  407. return $this->lastLogoutAt;
  408. }
  409. public function setLastLogoutAt(?\DateTimeInterface $lastLogoutAt): self
  410. {
  411. $this->lastLogoutAt = $lastLogoutAt;
  412. return $this;
  413. }
  414. /**
  415. * @return Collection<int, UserOffice>
  416. */
  417. public function getUserOffices(): Collection
  418. {
  419. return $this->userOffices;
  420. }
  421. public function addUserOffice(UserOffice $userOffice): self
  422. {
  423. if (!$this->userOffices->contains($userOffice)) {
  424. $this->userOffices[] = $userOffice;
  425. $userOffice->setUser($this);
  426. }
  427. return $this;
  428. }
  429. public function removeUserOffice(UserOffice $userOffice): self
  430. {
  431. if ($this->userOffices->removeElement($userOffice)) {
  432. // set the owning side to null (unless already changed)
  433. if ($userOffice->getUser() === $this) {
  434. $userOffice->setUser(null);
  435. }
  436. }
  437. return $this;
  438. }
  439. public function getDescription(): ?string
  440. {
  441. return $this->description;
  442. }
  443. public function setDescription(?string $description): self
  444. {
  445. $this->description = $description;
  446. return $this;
  447. }
  448. public function getLastname(): ?string
  449. {
  450. return $this->lastname;
  451. }
  452. public function setLastname(?string $lastname): self
  453. {
  454. $this->lastname = $lastname;
  455. return $this;
  456. }
  457. public function getFirstname(): ?string
  458. {
  459. return $this->firstname;
  460. }
  461. public function setFirstname(?string $firstname): self
  462. {
  463. $this->firstname = $firstname;
  464. return $this;
  465. }
  466. public function getFullname(): ?string
  467. {
  468. return $this->getFirstname().' '.$this->getLastname();
  469. }
  470. /**
  471. * @return Collection<int, Experience>
  472. */
  473. public function getUserExperiences(): Collection
  474. {
  475. return $this->userExperiences;
  476. }
  477. public function addUserExperience(Experience $userExperience): self
  478. {
  479. if (!$this->userExperiences->contains($userExperience)) {
  480. $this->userExperiences[] = $userExperience;
  481. $userExperience->setUser($this);
  482. }
  483. return $this;
  484. }
  485. public function removeUserExperience(Experience $userExperience): self
  486. {
  487. if ($this->userExperiences->removeElement($userExperience)) {
  488. // set the owning side to null (unless already changed)
  489. if ($userExperience->getUser() === $this) {
  490. $userExperience->setUser(null);
  491. }
  492. }
  493. return $this;
  494. }
  495. /**
  496. * @return Collection<int, Course>
  497. */
  498. public function getCourses(): Collection
  499. {
  500. return $this->courses;
  501. }
  502. public function addCourse(Course $course): self
  503. {
  504. if (!$this->courses->contains($course)) {
  505. $this->courses[] = $course;
  506. $course->setPublishedBy($this);
  507. }
  508. return $this;
  509. }
  510. public function removeCourse(Course $course): self
  511. {
  512. if ($this->courses->removeElement($course)) {
  513. // set the owning side to null (unless already changed)
  514. if ($course->getPublishedBy() === $this) {
  515. $course->setPublishedBy(null);
  516. }
  517. }
  518. return $this;
  519. }
  520. /**
  521. * @return Collection<int, Role>
  522. */
  523. public function getUserRoles(): Collection
  524. {
  525. return $this->userRoles;
  526. }
  527. public function addUserRole(Role $userRole): self
  528. {
  529. if (!$this->userRoles->contains($userRole)) {
  530. $this->userRoles[] = $userRole;
  531. $userRole->addUser($this);
  532. }
  533. return $this;
  534. }
  535. public function removeUserRole(Role $userRole): self
  536. {
  537. if ($this->userRoles->removeElement($userRole)) {
  538. $userRole->removeUser($this);
  539. }
  540. return $this;
  541. }
  542. /**
  543. * @return Collection<int, Enrollment>
  544. */
  545. public function getEnrollments(): Collection
  546. {
  547. return $this->enrollments;
  548. }
  549. public function addEnrollment(Enrollment $enrollment): self
  550. {
  551. if (!$this->enrollments->contains($enrollment)) {
  552. $this->enrollments[] = $enrollment;
  553. $enrollment->setUser($this);
  554. }
  555. return $this;
  556. }
  557. public function removeEnrollment(Enrollment $enrollment): self
  558. {
  559. if ($this->enrollments->removeElement($enrollment)) {
  560. // set the owning side to null (unless already changed)
  561. if ($enrollment->getUser() === $this) {
  562. $enrollment->setUser(null);
  563. }
  564. }
  565. return $this;
  566. }
  567. public function getCountry(): ?Country
  568. {
  569. return $this->country;
  570. }
  571. public function setCountry(?Country $country): self
  572. {
  573. $this->country = $country;
  574. return $this;
  575. }
  576. public function isIsFirstConnexion(): ?bool
  577. {
  578. return $this->isFirstConnexion;
  579. }
  580. public function setIsFirstConnexion(?bool $isFirstConnexion): self
  581. {
  582. $this->isFirstConnexion = $isFirstConnexion;
  583. return $this;
  584. }
  585. /**
  586. * @return Collection<int, ModuleView>
  587. */
  588. public function getModuleViews(): Collection
  589. {
  590. return $this->moduleViews;
  591. }
  592. public function addModuleView(ModuleView $moduleView): self
  593. {
  594. if (!$this->moduleViews->contains($moduleView)) {
  595. $this->moduleViews[] = $moduleView;
  596. $moduleView->setCreatedBy($this);
  597. }
  598. return $this;
  599. }
  600. public function removeModuleView(ModuleView $moduleView): self
  601. {
  602. if ($this->moduleViews->removeElement($moduleView)) {
  603. // set the owning side to null (unless already changed)
  604. if ($moduleView->getCreatedBy() === $this) {
  605. $moduleView->setCreatedBy(null);
  606. }
  607. }
  608. return $this;
  609. }
  610. /**
  611. * @return Collection<int, ModuleLike>
  612. */
  613. public function getModuleLikes(): Collection
  614. {
  615. return $this->moduleLikes;
  616. }
  617. public function addModuleLike(ModuleLike $moduleLike): self
  618. {
  619. if (!$this->moduleLikes->contains($moduleLike)) {
  620. $this->moduleLikes[] = $moduleLike;
  621. $moduleLike->setUser($this);
  622. }
  623. return $this;
  624. }
  625. public function removeModuleLike(ModuleLike $moduleLike): self
  626. {
  627. if ($this->moduleLikes->removeElement($moduleLike)) {
  628. // set the owning side to null (unless already changed)
  629. if ($moduleLike->getUser() === $this) {
  630. $moduleLike->setUser(null);
  631. }
  632. }
  633. return $this;
  634. }
  635. /**
  636. * @return Collection<int, Module>
  637. */
  638. public function getModulePublishers(): Collection
  639. {
  640. return $this->modulePublishers;
  641. }
  642. public function addModulePublisher(Module $modulePublisher): self
  643. {
  644. if (!$this->modulePublishers->contains($modulePublisher)) {
  645. $this->modulePublishers[] = $modulePublisher;
  646. $modulePublisher->setPublishedBy($this);
  647. }
  648. return $this;
  649. }
  650. public function removeModulePublisher(Module $modulePublisher): self
  651. {
  652. if ($this->modulePublishers->removeElement($modulePublisher)) {
  653. // set the owning side to null (unless already changed)
  654. if ($modulePublisher->getPublishedBy() === $this) {
  655. $modulePublisher->setPublishedBy(null);
  656. }
  657. }
  658. return $this;
  659. }
  660. /**
  661. * @return Collection<int, UserQuizQuestion>
  662. */
  663. public function getUserQuizQuestions(): Collection
  664. {
  665. return $this->userQuizQuestions;
  666. }
  667. public function addUserQuizQuestion(UserQuizQuestion $userQuizQuestion): self
  668. {
  669. if (!$this->userQuizQuestions->contains($userQuizQuestion)) {
  670. $this->userQuizQuestions[] = $userQuizQuestion;
  671. $userQuizQuestion->setCreatedBy($this);
  672. }
  673. return $this;
  674. }
  675. public function removeUserQuizQuestion(UserQuizQuestion $userQuizQuestion): self
  676. {
  677. if ($this->userQuizQuestions->removeElement($userQuizQuestion)) {
  678. // set the owning side to null (unless already changed)
  679. if ($userQuizQuestion->getCreatedBy() === $this) {
  680. $userQuizQuestion->setCreatedBy(null);
  681. }
  682. }
  683. return $this;
  684. }
  685. /**
  686. * @return Collection<int, Quote>
  687. */
  688. public function getQuotes(): Collection
  689. {
  690. return $this->quotes;
  691. }
  692. public function addQuote(Quote $quote): self
  693. {
  694. if (!$this->quotes->contains($quote)) {
  695. $this->quotes[] = $quote;
  696. $quote->setPublishedBy($this);
  697. }
  698. return $this;
  699. }
  700. public function removeQuote(Quote $quote): self
  701. {
  702. if ($this->quotes->removeElement($quote)) {
  703. // set the owning side to null (unless already changed)
  704. if ($quote->getPublishedBy() === $this) {
  705. $quote->setPublishedBy(null);
  706. }
  707. }
  708. return $this;
  709. }
  710. /**
  711. * @return Collection<int, Director>
  712. */
  713. public function getDirectors(): Collection
  714. {
  715. return $this->directors;
  716. }
  717. public function addDirector(Director $director): self
  718. {
  719. if (!$this->directors->contains($director)) {
  720. $this->directors[] = $director;
  721. $director->setPublishedBy($this);
  722. }
  723. return $this;
  724. }
  725. public function removeDirector(Director $director): self
  726. {
  727. if ($this->directors->removeElement($director)) {
  728. // set the owning side to null (unless already changed)
  729. if ($director->getPublishedBy() === $this) {
  730. $director->setPublishedBy(null);
  731. }
  732. }
  733. return $this;
  734. }
  735. /**
  736. * @return Collection<int, Module>
  737. */
  738. public function getModules(): Collection
  739. {
  740. return $this->modules;
  741. }
  742. public function addModule(Module $module): self
  743. {
  744. if (!$this->modules->contains($module)) {
  745. $this->modules[] = $module;
  746. $module->addCoach($this);
  747. }
  748. return $this;
  749. }
  750. public function removeModule(Module $module): self
  751. {
  752. if ($this->modules->removeElement($module)) {
  753. $module->removeCoach($this);
  754. }
  755. return $this;
  756. }
  757. /**
  758. * @return Collection<int, Live>
  759. */
  760. public function getLives(): Collection
  761. {
  762. return $this->lives;
  763. }
  764. public function addLife(Live $life): self
  765. {
  766. if (!$this->lives->contains($life)) {
  767. $this->lives[] = $life;
  768. $life->addCoach($this);
  769. }
  770. return $this;
  771. }
  772. public function removeLife(Live $life): self
  773. {
  774. if ($this->lives->removeElement($life)) {
  775. $life->removeCoach($this);
  776. }
  777. return $this;
  778. }
  779. /**
  780. * @return Collection<int, LiveParticipant>
  781. */
  782. public function getLiveParticipants(): Collection
  783. {
  784. return $this->liveParticipants;
  785. }
  786. public function addLiveParticipant(LiveParticipant $liveParticipant): self
  787. {
  788. if (!$this->liveParticipants->contains($liveParticipant)) {
  789. $this->liveParticipants[] = $liveParticipant;
  790. $liveParticipant->setParticipant($this);
  791. }
  792. return $this;
  793. }
  794. public function removeLiveParticipant(LiveParticipant $liveParticipant): self
  795. {
  796. if ($this->liveParticipants->removeElement($liveParticipant)) {
  797. // set the owning side to null (unless already changed)
  798. if ($liveParticipant->getParticipant() === $this) {
  799. $liveParticipant->setParticipant(null);
  800. }
  801. }
  802. return $this;
  803. }
  804. public function getRegistrationNumber(): ?string
  805. {
  806. return $this->registrationNumber;
  807. }
  808. public function setRegistrationNumber(?string $registrationNumber): self
  809. {
  810. $this->registrationNumber = $registrationNumber;
  811. return $this;
  812. }
  813. public function getHierarchicalLevel(): ?string
  814. {
  815. return $this->hierarchicalLevel;
  816. }
  817. public function setHierarchicalLevel(?string $hierarchicalLevel): self
  818. {
  819. $this->hierarchicalLevel = $hierarchicalLevel;
  820. return $this;
  821. }
  822. /**
  823. * @return Collection<int, ModuleComment>
  824. */
  825. public function getModuleComments(): Collection
  826. {
  827. return $this->moduleComments;
  828. }
  829. public function addModuleComment(ModuleComment $moduleComment): self
  830. {
  831. if (!$this->moduleComments->contains($moduleComment)) {
  832. $this->moduleComments[] = $moduleComment;
  833. $moduleComment->setUser($this);
  834. }
  835. return $this;
  836. }
  837. public function removeModuleComment(ModuleComment $moduleComment): self
  838. {
  839. if ($this->moduleComments->removeElement($moduleComment)) {
  840. // set the owning side to null (unless already changed)
  841. if ($moduleComment->getUser() === $this) {
  842. $moduleComment->setUser(null);
  843. }
  844. }
  845. return $this;
  846. }
  847. public function getSubsidiaryCompany(): ?SubsidiaryCompany
  848. {
  849. return $this->subsidiaryCompany;
  850. }
  851. public function setSubsidiaryCompany(?SubsidiaryCompany $subsidiaryCompany): self
  852. {
  853. $this->subsidiaryCompany = $subsidiaryCompany;
  854. return $this;
  855. }
  856. public function getJob(): ?Job
  857. {
  858. return $this->job;
  859. }
  860. public function setJob(?Job $job): self
  861. {
  862. $this->job = $job;
  863. return $this;
  864. }
  865. public function getOffice(): ?Office
  866. {
  867. return $this->office;
  868. }
  869. public function setOffice(?Office $office): self
  870. {
  871. $this->office = $office;
  872. return $this;
  873. }
  874. public function getContract(): ?Contract
  875. {
  876. return $this->contract;
  877. }
  878. public function setContract(?Contract $contract): self
  879. {
  880. $this->contract = $contract;
  881. return $this;
  882. }
  883. public function getPhoneNumber(): ?string
  884. {
  885. return $this->phoneNumber;
  886. }
  887. public function setPhoneNumber(?string $phoneNumber): self
  888. {
  889. $this->phoneNumber = $phoneNumber;
  890. return $this;
  891. }
  892. public function getStatus(): ?string
  893. {
  894. return $this->status;
  895. }
  896. public function setStatus(?string $status): self
  897. {
  898. $this->status = $status;
  899. return $this;
  900. }
  901. public function isActive(): ?bool
  902. {
  903. return $this->active;
  904. }
  905. public function setActive(?bool $active): self
  906. {
  907. $this->active = $active;
  908. return $this;
  909. }
  910. public function getPhoto(): ?ImageManager
  911. {
  912. return $this->photo;
  913. }
  914. public function setPhoto(?ImageManager $photo): self
  915. {
  916. $this->photo = $photo;
  917. return $this;
  918. }
  919. public function getReferent(): ?string
  920. {
  921. return $this->referent;
  922. }
  923. public function setReferent(?string $referent): self
  924. {
  925. $this->referent = $referent;
  926. return $this;
  927. }
  928. public function getEntryDate(): ?\DateTimeInterface
  929. {
  930. return $this->entryDate;
  931. }
  932. public function setEntryDate(?\DateTimeInterface $entryDate): self
  933. {
  934. $this->entryDate = $entryDate;
  935. return $this;
  936. }
  937. public function getResponsible(): ?self
  938. {
  939. return $this->responsible;
  940. }
  941. public function setResponsible(?self $responsible): self
  942. {
  943. $this->responsible = $responsible;
  944. return $this;
  945. }
  946. /**
  947. * @return Collection<int, self>
  948. */
  949. public function getResponsibles(): Collection
  950. {
  951. return $this->responsibles;
  952. }
  953. public function addResponsible(self $responsible): self
  954. {
  955. if (!$this->responsibles->contains($responsible)) {
  956. $this->responsibles[] = $responsible;
  957. $responsible->setResponsible($this);
  958. }
  959. return $this;
  960. }
  961. public function removeResponsible(self $responsible): self
  962. {
  963. if ($this->responsibles->removeElement($responsible)) {
  964. // set the owning side to null (unless already changed)
  965. if ($responsible->getResponsible() === $this) {
  966. $responsible->setResponsible(null);
  967. }
  968. }
  969. return $this;
  970. }
  971. /**
  972. * @return Collection<int, ProgramParticipation>
  973. */
  974. public function getProgramParticipations(): Collection
  975. {
  976. return $this->programParticipations;
  977. }
  978. public function addProgramParticipation(ProgramParticipation $programParticipation): self
  979. {
  980. if (!$this->programParticipations->contains($programParticipation)) {
  981. $this->programParticipations[] = $programParticipation;
  982. $programParticipation->setCreatedBy($this);
  983. }
  984. return $this;
  985. }
  986. public function removeProgramParticipation(ProgramParticipation $programParticipation): self
  987. {
  988. if ($this->programParticipations->removeElement($programParticipation)) {
  989. // set the owning side to null (unless already changed)
  990. if ($programParticipation->getCreatedBy() === $this) {
  991. $programParticipation->setCreatedBy(null);
  992. }
  993. }
  994. return $this;
  995. }
  996. /**
  997. * @return Collection<int, ModuleParticipation>
  998. */
  999. public function getModuleParticipations(): Collection
  1000. {
  1001. return $this->moduleParticipations;
  1002. }
  1003. public function addModuleParticipation(ModuleParticipation $moduleParticipation): self
  1004. {
  1005. if (!$this->moduleParticipations->contains($moduleParticipation)) {
  1006. $this->moduleParticipations[] = $moduleParticipation;
  1007. $moduleParticipation->setCreatedBy($this);
  1008. }
  1009. return $this;
  1010. }
  1011. public function removeModuleParticipation(ModuleParticipation $moduleParticipation): self
  1012. {
  1013. if ($this->moduleParticipations->removeElement($moduleParticipation)) {
  1014. // set the owning side to null (unless already changed)
  1015. if ($moduleParticipation->getCreatedBy() === $this) {
  1016. $moduleParticipation->setCreatedBy(null);
  1017. }
  1018. }
  1019. return $this;
  1020. }
  1021. /**
  1022. * @return Collection<int, ModuleInscription>
  1023. */
  1024. public function getModuleInscriptions(): Collection
  1025. {
  1026. return $this->moduleInscriptions;
  1027. }
  1028. public function addModuleInscription(ModuleInscription $moduleInscription): self
  1029. {
  1030. if (!$this->moduleInscriptions->contains($moduleInscription)) {
  1031. $this->moduleInscriptions[] = $moduleInscription;
  1032. $moduleInscription->setUser($this);
  1033. }
  1034. return $this;
  1035. }
  1036. public function removeModuleInscription(ModuleInscription $moduleInscription): self
  1037. {
  1038. if ($this->moduleInscriptions->removeElement($moduleInscription)) {
  1039. // set the owning side to null (unless already changed)
  1040. if ($moduleInscription->getUser() === $this) {
  1041. $moduleInscription->setUser(null);
  1042. }
  1043. }
  1044. return $this;
  1045. }
  1046. /** @see \Serializable::serialize() */
  1047. public function serialize()
  1048. {
  1049. return serialize(array(
  1050. $this->id,
  1051. $this->email,
  1052. $this->password,
  1053. // see section on salt below
  1054. // $this->salt,
  1055. ));
  1056. }
  1057. /** @see \Serializable::serialize() */
  1058. public function __serialize()
  1059. {
  1060. return array(
  1061. $this->id,
  1062. $this->email,
  1063. $this->password,
  1064. // see section on salt below
  1065. // $this->salt,
  1066. );
  1067. }
  1068. /** @see \Serializable::unserialize() */
  1069. public function unserialize($serialized)
  1070. {
  1071. list (
  1072. $this->id,
  1073. $this->email,
  1074. $this->password,
  1075. // see section on salt below
  1076. // $this->salt
  1077. ) = unserialize($serialized);
  1078. }
  1079. /** @see \Serializable::unserialize() */
  1080. public function __unserialize($serialized)
  1081. {
  1082. list (
  1083. $this->id,
  1084. $this->email,
  1085. $this->password,
  1086. // see section on salt below
  1087. // $this->salt
  1088. ) = unserialize(serialize($serialized));
  1089. }
  1090. public function getActivationCode(): ?string
  1091. {
  1092. return $this->activationCode;
  1093. }
  1094. public function setActivationCode(?string $activationCode): self
  1095. {
  1096. $this->activationCode = $activationCode;
  1097. return $this;
  1098. }
  1099. public function getActivationCodeExpiredAt(): ?\DateTimeInterface
  1100. {
  1101. return $this->activationCodeExpiredAt;
  1102. }
  1103. public function setActivationCodeExpiredAt(?\DateTimeInterface $activationCodeExpiredAt): self
  1104. {
  1105. $this->activationCodeExpiredAt = $activationCodeExpiredAt;
  1106. return $this;
  1107. }
  1108. public function getResetCode(): ?string
  1109. {
  1110. return $this->resetCode;
  1111. }
  1112. public function setResetCode(?string $resetCode): self
  1113. {
  1114. $this->resetCode = $resetCode;
  1115. return $this;
  1116. }
  1117. public function getResetCodeExpiredAt(): ?\DateTimeInterface
  1118. {
  1119. return $this->resetCodeExpiredAt;
  1120. }
  1121. public function setResetCodeExpiredAt(?\DateTimeInterface $resetCodeExpiredAt): self
  1122. {
  1123. $this->resetCodeExpiredAt = $resetCodeExpiredAt;
  1124. return $this;
  1125. }
  1126. public function getDeviceTokens(): ?array
  1127. {
  1128. return $this->deviceTokens;
  1129. }
  1130. public function setDeviceTokens(?array $deviceTokens): self
  1131. {
  1132. $this->deviceTokens = $deviceTokens;
  1133. return $this;
  1134. }
  1135. /**
  1136. * @return Collection<int, Discussion>
  1137. */
  1138. public function getSenderDiscussions(): Collection
  1139. {
  1140. return $this->senderDiscussions;
  1141. }
  1142. public function addSenderDiscussion(Discussion $senderDiscussion): self
  1143. {
  1144. if (!$this->senderDiscussions->contains($senderDiscussion)) {
  1145. $this->senderDiscussions[] = $senderDiscussion;
  1146. $senderDiscussion->setCreatedBy($this);
  1147. }
  1148. return $this;
  1149. }
  1150. public function removeSenderDiscussion(Discussion $senderDiscussion): self
  1151. {
  1152. if ($this->senderDiscussions->removeElement($senderDiscussion)) {
  1153. // set the owning side to null (unless already changed)
  1154. if ($senderDiscussion->getCreatedBy() === $this) {
  1155. $senderDiscussion->setCreatedBy(null);
  1156. }
  1157. }
  1158. return $this;
  1159. }
  1160. /**
  1161. * @return Collection<int, Discussion>
  1162. */
  1163. public function getReceiverDiscussions(): Collection
  1164. {
  1165. return $this->receiverDiscussions;
  1166. }
  1167. public function addReceiverDiscussion(Discussion $receiverDiscussion): self
  1168. {
  1169. if (!$this->receiverDiscussions->contains($receiverDiscussion)) {
  1170. $this->receiverDiscussions[] = $receiverDiscussion;
  1171. $receiverDiscussion->setCreatedBy($this);
  1172. }
  1173. return $this;
  1174. }
  1175. public function removeReceiverDiscussion(Discussion $receiverDiscussion): self
  1176. {
  1177. if ($this->receiverDiscussions->removeElement($receiverDiscussion)) {
  1178. // set the owning side to null (unless already changed)
  1179. if ($receiverDiscussion->getCreatedBy() === $this) {
  1180. $receiverDiscussion->setCreatedBy(null);
  1181. }
  1182. }
  1183. return $this;
  1184. }
  1185. /**
  1186. * @return Collection<int, Message>
  1187. */
  1188. public function getMessages(): Collection
  1189. {
  1190. return $this->messages;
  1191. }
  1192. public function addMessage(Message $message): self
  1193. {
  1194. if (!$this->messages->contains($message)) {
  1195. $this->messages[] = $message;
  1196. $message->setReceiver($this);
  1197. }
  1198. return $this;
  1199. }
  1200. public function removeMessage(Message $message): self
  1201. {
  1202. if ($this->messages->removeElement($message)) {
  1203. // set the owning side to null (unless already changed)
  1204. if ($message->getReceiver() === $this) {
  1205. $message->setReceiver(null);
  1206. }
  1207. }
  1208. return $this;
  1209. }
  1210. public function isVerified(): bool
  1211. {
  1212. return $this->isVerified;
  1213. }
  1214. public function setIsVerified(bool $isVerified): self
  1215. {
  1216. $this->isVerified = $isVerified;
  1217. return $this;
  1218. }
  1219. public function getProfileColor(): ?string
  1220. {
  1221. return $this->profileColor;
  1222. }
  1223. public function setProfileColor(?string $profileColor): self
  1224. {
  1225. $this->profileColor = $profileColor;
  1226. return $this;
  1227. }
  1228. /**
  1229. * @return Collection<int, Program>
  1230. */
  1231. public function getPrograms(): Collection
  1232. {
  1233. return $this->programs;
  1234. }
  1235. public function addProgram(Program $program): self
  1236. {
  1237. if (!$this->programs->contains($program)) {
  1238. $this->programs[] = $program;
  1239. $program->addUser($this);
  1240. }
  1241. return $this;
  1242. }
  1243. public function removeProgram(Program $program): self
  1244. {
  1245. if ($this->programs->removeElement($program)) {
  1246. $program->removeUser($this);
  1247. }
  1248. return $this;
  1249. }
  1250. /**
  1251. * @return Collection<int, UserModuleParticipation>
  1252. */
  1253. public function getUserModuleParticipations(): Collection
  1254. {
  1255. return $this->userModuleParticipations;
  1256. }
  1257. public function addUserModuleParticipation(UserModuleParticipation $userModuleParticipation): self
  1258. {
  1259. if (!$this->userModuleParticipations->contains($userModuleParticipation)) {
  1260. $this->userModuleParticipations[] = $userModuleParticipation;
  1261. $userModuleParticipation->setParticipant($this);
  1262. }
  1263. return $this;
  1264. }
  1265. public function removeUserModuleParticipation(UserModuleParticipation $userModuleParticipation): self
  1266. {
  1267. if ($this->userModuleParticipations->removeElement($userModuleParticipation)) {
  1268. // set the owning side to null (unless already changed)
  1269. if ($userModuleParticipation->getParticipant() === $this) {
  1270. $userModuleParticipation->setParticipant(null);
  1271. }
  1272. }
  1273. return $this;
  1274. }
  1275. public function isIsInternalAccount(): ?bool
  1276. {
  1277. return $this->isInternalAccount;
  1278. }
  1279. public function setIsInternalAccount(?bool $isInternalAccount): self
  1280. {
  1281. $this->isInternalAccount = $isInternalAccount;
  1282. return $this;
  1283. }
  1284. public function getElapsedTime(): ?int
  1285. {
  1286. return $this->elapsedTime;
  1287. }
  1288. public function setElapsedTime(?int $elapsedTime): self
  1289. {
  1290. $this->elapsedTime = $elapsedTime;
  1291. return $this;
  1292. }
  1293. /**
  1294. * @return Collection<int, Notification>
  1295. */
  1296. public function getNotifications(): Collection
  1297. {
  1298. return $this->notifications;
  1299. }
  1300. public function addNotification(Notification $notification): self
  1301. {
  1302. if (!$this->notifications->contains($notification)) {
  1303. $this->notifications[] = $notification;
  1304. $notification->setReceiver($this);
  1305. }
  1306. return $this;
  1307. }
  1308. public function removeNotification(Notification $notification): self
  1309. {
  1310. if ($this->notifications->removeElement($notification)) {
  1311. // set the owning side to null (unless already changed)
  1312. if ($notification->getReceiver() === $this) {
  1313. $notification->setReceiver(null);
  1314. }
  1315. }
  1316. return $this;
  1317. }
  1318. /**
  1319. * @return Collection<int, NotificationReceiver>
  1320. */
  1321. public function getNotificationReceivers(): Collection
  1322. {
  1323. return $this->notificationReceivers;
  1324. }
  1325. public function addNotificationReceiver(NotificationReceiver $notificationReceiver): self
  1326. {
  1327. if (!$this->notificationReceivers->contains($notificationReceiver)) {
  1328. $this->notificationReceivers[] = $notificationReceiver;
  1329. $notificationReceiver->setReceiver($this);
  1330. }
  1331. return $this;
  1332. }
  1333. public function removeNotificationReceiver(NotificationReceiver $notificationReceiver): self
  1334. {
  1335. if ($this->notificationReceivers->removeElement($notificationReceiver)) {
  1336. // set the owning side to null (unless already changed)
  1337. if ($notificationReceiver->getReceiver() === $this) {
  1338. $notificationReceiver->setReceiver(null);
  1339. }
  1340. }
  1341. return $this;
  1342. }
  1343. public function getLastLoginNotifiedAt(): ?\DateTimeInterface
  1344. {
  1345. return $this->lastLoginNotifiedAt;
  1346. }
  1347. public function setLastLoginNotifiedAt(?\DateTimeInterface $lastLoginNotifiedAt): self
  1348. {
  1349. $this->lastLoginNotifiedAt = $lastLoginNotifiedAt;
  1350. return $this;
  1351. }
  1352. /**
  1353. * @return Collection<int, Message>
  1354. */
  1355. public function getReceiverMessages(): Collection
  1356. {
  1357. return $this->receiverMessages;
  1358. }
  1359. public function addReceiverMessage(Message $receiverMessage): self
  1360. {
  1361. if (!$this->receiverMessages->contains($receiverMessage)) {
  1362. $this->receiverMessages[] = $receiverMessage;
  1363. $receiverMessage->setReceiver($this);
  1364. }
  1365. return $this;
  1366. }
  1367. public function removeReceiverMessage(Message $receiverMessage): self
  1368. {
  1369. if ($this->receiverMessages->removeElement($receiverMessage)) {
  1370. // set the owning side to null (unless already changed)
  1371. if ($receiverMessage->getReceiver() === $this) {
  1372. $receiverMessage->setReceiver(null);
  1373. }
  1374. }
  1375. return $this;
  1376. }
  1377. }