src/Core/Entity/User.php line 28

Open in your IDE?
  1. <?php
  2. namespace App\Core\Entity;
  3. use App\Core\Entity\Chat\Participante;
  4. use App\Core\Entity\Seguidor;
  5. use App\Core\Entity\Bloqueos;
  6. use App\Core\Entity\Cybersource\CybersourceTransLog;
  7. use App\Core\Entity\Institucion\Director;
  8. use App\Core\Entity\TutorialUsuario;
  9. use App\Entity\Calendario;
  10. use Doctrine\Common\Collections\ArrayCollection;
  11. use Doctrine\Common\Collections\Collection;
  12. use Doctrine\ORM\Mapping as ORM;
  13. use Symfony\Component\HttpFoundation\File\UploadedFile;
  14. use Symfony\Component\Security\Core\User\UserInterface;
  15. use Symfony\Component\HttpFoundation\File\File;
  16. use Symfony\Component\Serializer\Annotation\Groups;
  17. use Symfony\Component\Serializer\SerializerInterface;
  18. use Vich\UploaderBundle\Mapping\Annotation as Vich;
  19. use App\Core\Entity\Country;
  20. use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface;
  21. /**
  22. * @ORM\Entity(repositoryClass="App\Core\Repository\UserRepository")
  23. * @Vich\Uploadable()
  24. */
  25. class User implements UserInterface, SerializerInterface, PasswordAuthenticatedUserInterface
  26. {
  27. const JSON_FIELDS = [
  28. 'id', 'imageName', 'primerNombre', 'segundoNombre', 'tercerNombre', 'primerApellido', 'segundoApellido', 'nombreCompleto', 'email', 'username', 'numeroTelefonico', 'fechaNacimiento', 'genero', 'informacionPerfil' => ['id'], 'idioma', 'createdAt', 'emailConfirmado', 'paisCodigoTelefonicoId' => ['id', 'nombre', 'codigoTelefonico']
  29. ];
  30. const ARRAY_GROUPS_TO_SERIALIZE = ['user','main','informacionPerfil', 'city', 'idiomaPerfil', 'idioma', 'empleoPerfil', 'empleo', 'colegioPerfil', 'colegio', 'profesionPerfil', 'profesion', 'universidadPerfil', 'universidad'];
  31. /**
  32. * @ORM\Id()
  33. * @ORM\GeneratedValue()
  34. * @ORM\Column(type="integer")
  35. * @Groups("main")
  36. */
  37. private $id;
  38. /**
  39. * @ORM\Column(type="string", length=180, unique=true)
  40. * @Groups("main")
  41. */
  42. private $email;
  43. /**
  44. * @ORM\Column(type="string", length=180, unique=true, nullable=true)
  45. * @Groups("main")
  46. */
  47. private $username;
  48. /**
  49. * @ORM\Column(type="string", length=50, unique=true, nullable=true)
  50. * @Groups("main")
  51. */
  52. private $googleId;
  53. /**
  54. * @ORM\Column(type="string", length=50, unique=true, nullable=true)
  55. * @Groups("main")
  56. */
  57. private $facebookId;
  58. /**
  59. * @ORM\Column(type="array")
  60. */
  61. private $roles = [];
  62. /**
  63. * @var string The hashed password
  64. * @ORM\Column(type="string", nullable=true)
  65. */
  66. private $password;
  67. /**
  68. * @ORM\Column(type="string", length=50)
  69. * @Groups("main")
  70. */
  71. private $primerNombre;
  72. /**
  73. * @ORM\Column(type="string", length=50, nullable=true)
  74. * * @Groups("main")
  75. */
  76. private $segundoNombre;
  77. /**
  78. * @ORM\Column(type="string", length=50, nullable=true)
  79. * * @Groups("main")
  80. */
  81. private $tercerNombre;
  82. /**
  83. * @ORM\Column(type="string", length=50)
  84. * @Groups("main")
  85. */
  86. private $primerApellido;
  87. /**
  88. * @ORM\Column(type="string", length=50, nullable=true)
  89. * @Groups("main")
  90. */
  91. private $segundoApellido;
  92. /**
  93. * @ORM\Column(type="string", length=255)
  94. * @Groups("main")
  95. */
  96. private $nombreCompleto;
  97. /**
  98. * @ORM\OneToOne(targetEntity="App\Core\Entity\Maestro", mappedBy="user", cascade={"persist", "remove"})
  99. */
  100. private $maestro;
  101. /**
  102. * @ORM\OneToOne(targetEntity="App\Core\Entity\Estudiante", mappedBy="user", cascade={"persist", "remove"})
  103. */
  104. private $estudiante;
  105. /**
  106. * NOTE: This is not a mapped field of entity metadata, just a simple property.
  107. *
  108. * @Vich\UploadableField(mapping="imagen_de_usuario", fileNameProperty="imageName", size="imageSize")
  109. *
  110. * @var File|null
  111. */
  112. private $imageFile;
  113. /**
  114. * @ORM\Column(type="string", length=200, nullable=true)
  115. * @Groups("main")
  116. *
  117. * @var string|null
  118. */
  119. private $imageName;
  120. /**
  121. * @ORM\Column(type="integer", nullable=true)
  122. *
  123. * @var int|null
  124. */
  125. private $imageSize;
  126. /**
  127. * @ORM\Column(type="string", length=16, nullable=true)
  128. * @Groups("main")
  129. */
  130. private $numeroTelefonico;
  131. /**
  132. * @ORM\ManyToOne(targetEntity=Country::class)
  133. * @ORM\JoinColumn(nullable=true)
  134. */
  135. private $paisCodigoTelefonico;
  136. /**
  137. * @ORM\Column(type="date", nullable=true)
  138. * @Groups("main")
  139. */
  140. private $fechaNacimiento;
  141. /**
  142. * @ORM\Column(type="integer", nullable=true)
  143. * @Groups("main")
  144. */
  145. private $genero;
  146. /**
  147. * @ORM\OneToOne(targetEntity="App\Core\Entity\InformacionPerfil")
  148. * @ORM\JoinColumn(nullable=true)
  149. * @Groups("main")
  150. */
  151. private $informacionPerfil;
  152. /**
  153. * @ORM\Column(type="string", length=10, nullable=false)
  154. * @Groups("main")
  155. */
  156. private $idioma;
  157. /**
  158. * @ORM\OneToMany(targetEntity="App\Core\Entity\CategoriaUsuario", mappedBy="usuario", orphanRemoval=false)
  159. */
  160. private $categoriasUsuario;
  161. /**
  162. * @ORM\OneToMany(targetEntity=Participante::class, mappedBy="usuario", orphanRemoval=true)
  163. */
  164. private $participacionesChat;
  165. /**
  166. * @ORM\OneToMany(targetEntity=Seguidor::class, mappedBy="seguidor")
  167. */
  168. private $seguidos;
  169. /**
  170. * @ORM\OneToMany(targetEntity=Seguidor::class, mappedBy="seguido")
  171. */
  172. private $seguidores;
  173. public $yaSeguido;
  174. /**
  175. * @ORM\OneToMany(targetEntity=Bloqueos::class, mappedBy="bloqueador")
  176. */
  177. private $bloqueados;
  178. /**
  179. * @ORM\OneToMany(targetEntity=Bloqueos::class, mappedBy="bloqueado")
  180. */
  181. private $bloqueadores;
  182. /**
  183. * @ORM\Column(type="datetime")
  184. * @Groups("main")
  185. */
  186. private $createdAt;
  187. /**
  188. * @ORM\OneToMany(targetEntity=CybersourceTransLog::class, mappedBy="user", orphanRemoval=true)
  189. */
  190. private $cybersourceTransLogs;
  191. /**
  192. * @ORM\Column(type="string", length=255, nullable=true)
  193. */
  194. private $tokenConfirmarEmail;
  195. /**
  196. * @ORM\Column(type="string", length=255, nullable=true)
  197. */
  198. private $tokenRecuperarPassword;
  199. /**
  200. * @ORM\Column(type="boolean", nullable=true, options={"default": false})
  201. */
  202. private $emailConfirmado = false;
  203. /**
  204. * @ORM\Column(type="boolean", nullable=true, options={"default": false})
  205. */
  206. private $debitoAutomatico = false;
  207. /**
  208. * @ORM\Column(type="string", length=255, nullable=true)
  209. */
  210. private $tokenCybersource;
  211. /**
  212. * @ORM\OneToOne(targetEntity=Director::class, mappedBy="usuario", cascade={"persist", "remove"})
  213. */
  214. private $director;
  215. /**
  216. * @ORM\OneToMany(targetEntity=TutorialUsuario::class, mappedBy="user", orphanRemoval=true)
  217. */
  218. private $tutorialesUsuario;
  219. /**
  220. * @ORM\OneToMany(targetEntity=Notificacion::class, mappedBy="destinatario", orphanRemoval=true)
  221. */
  222. private $notificaciones;
  223. /**
  224. * @ORM\Column(type="boolean", nullable=true, options={"default": true})
  225. */
  226. private $tutorial = true;
  227. /**
  228. * @ORM\OneToOne(targetEntity=Calendario::class, cascade={"persist", "remove"})
  229. */
  230. private $calendario;
  231. public function __construct()
  232. {
  233. $this->categoriasUsuario = new ArrayCollection();
  234. $this->participacionesChat = new ArrayCollection();
  235. $this->seguidos = new ArrayCollection();
  236. $this->seguidores = new ArrayCollection();
  237. $this->bloqueados = new ArrayCollection();
  238. $this->bloqueadores = new ArrayCollection();
  239. $this->cybersourceTransLogs = new ArrayCollection();
  240. $this->tutorialesUsuario = new ArrayCollection();
  241. $this->notificaciones = new ArrayCollection();
  242. }
  243. /**
  244. * @return bool
  245. */
  246. public function isTutorial(): bool
  247. {
  248. return $this->tutorial;
  249. }
  250. /**
  251. * @param bool $tutorial
  252. */
  253. public function setTutorial(bool $tutorial): void
  254. {
  255. $this->tutorial = $tutorial;
  256. }
  257. public function getId(): ?int
  258. {
  259. return $this->id;
  260. }
  261. public function getUserIdentifier(): string
  262. {
  263. return $this->username;
  264. }
  265. public function getEmail(): ?string
  266. {
  267. return $this->email;
  268. }
  269. public function setEmail(string $email): self
  270. {
  271. $this->email = $email;
  272. return $this;
  273. }
  274. /**
  275. * A visual identifier that represents this user.
  276. *
  277. * @see UserInterface
  278. */
  279. public function getUsername(): string
  280. {
  281. return (string) $this->username;
  282. }
  283. public function setUsername(string $username): self
  284. {
  285. $this->username = $username;
  286. return $this;
  287. }
  288. public function getGoogleId(): ?string
  289. {
  290. return $this->googleId;
  291. }
  292. public function setGoogleId(?string $googleId): self
  293. {
  294. $this->googleId = $googleId;
  295. return $this;
  296. }
  297. public function getFacebookId(): ?string
  298. {
  299. return $this->facebookId;
  300. }
  301. public function setFacebookId(?string $facebookId): self
  302. {
  303. $this->facebookId = $facebookId;
  304. return $this;
  305. }
  306. /**
  307. * @see UserInterface
  308. */
  309. public function getRoles(): array
  310. {
  311. $roles = $this->roles;
  312. // guarantee every user at least has ROLE_USER
  313. $roles[] = 'ROLE_USER';
  314. return array_unique($roles);
  315. }
  316. public function setRoles(array $roles): self
  317. {
  318. $this->roles = $roles;
  319. return $this;
  320. }
  321. /**
  322. * @see UserInterface
  323. */
  324. public function getPassword(): string
  325. {
  326. return (string) $this->password;
  327. }
  328. public function setPassword(string $password): self
  329. {
  330. $this->password = $password;
  331. return $this;
  332. }
  333. /**
  334. * @see UserInterface
  335. */
  336. public function getSalt()
  337. {
  338. // not needed when using the "bcrypt" algorithm in security.yaml
  339. }
  340. /**
  341. * @see UserInterface
  342. */
  343. public function eraseCredentials()
  344. {
  345. // If you store any temporary, sensitive data on the user, clear it here
  346. // $this->plainPassword = null;
  347. }
  348. public function getPrimerNombre(): ?string
  349. {
  350. return $this->primerNombre;
  351. }
  352. public function setPrimerNombre(string $primerNombre): self
  353. {
  354. $this->primerNombre = $primerNombre;
  355. return $this;
  356. }
  357. public function getSegundoNombre(): ?string
  358. {
  359. return $this->segundoNombre;
  360. }
  361. public function setSegundoNombre(string $segundoNombre): self
  362. {
  363. $this->segundoNombre = $segundoNombre;
  364. return $this;
  365. }
  366. public function getTercerNombre(): ?string
  367. {
  368. return $this->tercerNombre;
  369. }
  370. public function setTercerNombre(string $tercerNombre): self
  371. {
  372. $this->tercerNombre = $tercerNombre;
  373. return $this;
  374. }
  375. public function getPrimerApellido(): ?string
  376. {
  377. return $this->primerApellido;
  378. }
  379. public function setPrimerApellido(string $primerApellido): self
  380. {
  381. $this->primerApellido = $primerApellido;
  382. return $this;
  383. }
  384. public function getSegundoApellido(): ?string
  385. {
  386. return $this->segundoApellido;
  387. }
  388. public function setSegundoApellido(?string $segundoApellido): self
  389. {
  390. $this->segundoApellido = $segundoApellido;
  391. return $this;
  392. }
  393. public function getNombreCompleto(): ?string
  394. {
  395. return $this->nombreCompleto;
  396. }
  397. public function asignarNombreCompleto(): self
  398. {
  399. $nombres = '';
  400. $nombres .= $this->primerNombre . ' ';
  401. if ($this->segundoNombre) {
  402. $nombres .= $this->segundoNombre . ' ';
  403. }
  404. if ($this->tercerNombre) {
  405. $nombres .= $this->tercerNombre . ' ';
  406. }
  407. $nombres .= $this->primerApellido;
  408. if ($this->segundoApellido) {
  409. $nombres .= ' ' . $this->segundoApellido;
  410. }
  411. $this->nombreCompleto = $nombres;
  412. return $this;
  413. }
  414. public function getMaestro(): ?Maestro
  415. {
  416. return $this->maestro;
  417. }
  418. public function setMaestro(Maestro $maestro): self
  419. {
  420. $this->maestro = $maestro;
  421. // set the owning side of the relation if necessary
  422. if ($maestro->getUser() !== $this) {
  423. $maestro->setUser($this);
  424. }
  425. return $this;
  426. }
  427. public function getEstudiante(): ?Estudiante
  428. {
  429. return $this->estudiante;
  430. }
  431. public function setEstudiante(Estudiante $estudiante): self
  432. {
  433. $this->estudiante = $estudiante;
  434. // set the owning side of the relation if necessary
  435. if ($estudiante->getUser() !== $this) {
  436. $estudiante->setUser($this);
  437. }
  438. return $this;
  439. }
  440. /**
  441. * If manually uploading a file (i.e. not using Symfony Form) ensure an instance
  442. * of 'UploadedFile' is injected into this setter to trigger the update. If this
  443. * bundle's configuration parameter 'inject_on_load' is set to 'true' this setter
  444. * must be able to accept an instance of 'File' as the bundle will inject one here
  445. * during Doctrine hydration.
  446. *
  447. * @param File|UploadedFile|null $uploadedFile
  448. */
  449. public function setImageFile(?File $uploadedFile = null): void
  450. {
  451. $this->imageFile = $uploadedFile;
  452. if (null !== $uploadedFile) {
  453. // It is required that at least one field changes if you are using doctrine
  454. // otherwise the event listeners won't be called and the file is lost
  455. $this->setImageSize($uploadedFile->getSize());
  456. }
  457. }
  458. public function getImageFile(): ?File
  459. {
  460. return $this->imageFile;
  461. }
  462. public function setImageName(?string $imageName): void
  463. {
  464. $this->imageName = $imageName;
  465. }
  466. public function getImageName(): ?string
  467. {
  468. return $this->imageName;
  469. }
  470. public function setImageSize(?int $imageSize): void
  471. {
  472. $this->imageSize = $imageSize;
  473. }
  474. public function getImageSize(): ?int
  475. {
  476. return $this->imageSize;
  477. }
  478. /**
  479. * @inheritDoc
  480. */
  481. public function serialize($data, $format, array $context = [])
  482. {
  483. // TODO: Implement serialize() method.
  484. }
  485. /**
  486. * @inheritDoc
  487. */
  488. public function deserialize($data, $type, $format, array $context = [])
  489. {
  490. // TODO: Implement deserialize() method.
  491. }
  492. public function getNumeroTelefonico(): ?string
  493. {
  494. return $this->numeroTelefonico;
  495. }
  496. public function setNumeroTelefonico(?string $numeroTelefonico): self
  497. {
  498. $this->numeroTelefonico = $numeroTelefonico;
  499. return $this;
  500. }
  501. public function getFechaNacimiento(): ?\DateTimeInterface
  502. {
  503. return $this->fechaNacimiento;
  504. }
  505. public function setFechaNacimiento(?\DateTimeInterface $fechaNacimiento): self
  506. {
  507. $this->fechaNacimiento = $fechaNacimiento;
  508. return $this;
  509. }
  510. public function getGenero(): ?int
  511. {
  512. return $this->genero;
  513. }
  514. public function setGenero(?int $genero): self
  515. {
  516. $this->genero = $genero;
  517. return $this;
  518. }
  519. public function getInformacionPerfil(): ?InformacionPerfil
  520. {
  521. return $this->informacionPerfil;
  522. }
  523. public function setInformacionPerfil(InformacionPerfil $informacionPerfil): self
  524. {
  525. $this->informacionPerfil = $informacionPerfil;
  526. return $this;
  527. }
  528. function asignarNombresUsuario($todosLosNombres) {
  529. //Separa los nombres que ingres
  530. $nombres = $this->eliminarPosicionesVacias(explode(" ", trim($todosLosNombres)));
  531. $this->setPrimerNombre($nombres[0]);
  532. if(count($nombres) > 1) {
  533. $this->setSegundoNombre($nombres[1]);
  534. if(count($nombres) > 2) {
  535. $tercerNombre = '';
  536. for ($i = 2; $i < count($nombres); $i++) {
  537. $tercerNombre .= $nombres[$i];
  538. if ($i !== count($nombres) - 1) {
  539. $tercerNombre .= ' ';
  540. }
  541. }
  542. $this->setTercerNombre($tercerNombre);
  543. }
  544. }
  545. }
  546. function asignarApellidosUsuario($todosLosApellidos) {
  547. //Separa los apellidos que ingres
  548. $apellidos = $this->eliminarPosicionesVacias(explode(" ", trim($todosLosApellidos)));
  549. $this->setPrimerApellido($apellidos[0]);
  550. if(count($apellidos) >= 2) {
  551. $segundoApellido = '';
  552. for ($i = 1; $i < count($apellidos); $i++) {
  553. $segundoApellido .= $apellidos[$i];
  554. if ($i !== count($apellidos) - 1) {
  555. $segundoApellido .= ' ';
  556. }
  557. }
  558. $this->setSegundoApellido($segundoApellido);
  559. }
  560. }
  561. function eliminarPosicionesVacias($stringsArray) {
  562. $nuevoArray = [];
  563. foreach ($stringsArray as $string) {
  564. if (trim($string) !== '') {
  565. array_push($nuevoArray, $string);
  566. }
  567. }
  568. return $nuevoArray;
  569. }
  570. public function getIdioma(): ?string
  571. {
  572. return $this->idioma;
  573. }
  574. public function setIdioma(string $idioma): self
  575. {
  576. $this->idioma = $idioma;
  577. return $this;
  578. }
  579. /**
  580. * @return Collection|CategoriaUsuario[]
  581. */
  582. public function getCategoriasUsuario(): Collection
  583. {
  584. return $this->categoriasUsuario;
  585. }
  586. public function addCategoriaUsuario(CategoriaUsuario $categoriaUsuario): self
  587. {
  588. if (!$this->categoriasUsuario->contains($categoriaUsuario)) {
  589. $this->categoriasUsuario[] = $categoriaUsuario;
  590. $categoriaUsuario->setUsuario($this);
  591. }
  592. return $this;
  593. }
  594. public function removeCategoriaUsuario(CategoriaUsuario $categoriaUsuario): self
  595. {
  596. if ($this->categoriasUsuario->contains($categoriaUsuario)) {
  597. $this->categoriasUsuario->removeElement($categoriaUsuario);
  598. // set the owning side to null (unless already changed)
  599. if ($categoriaUsuario->getUsuario() === $this) {
  600. $categoriaUsuario->setUsuario(null);
  601. }
  602. }
  603. return $this;
  604. }
  605. /**
  606. * @return Collection|Participante[]
  607. */
  608. public function getParticipacionesChat(): Collection
  609. {
  610. return $this->participacionesChat;
  611. }
  612. public function addParticipacionesChat(Participante $participacionesChat): self
  613. {
  614. if (!$this->participacionesChat->contains($participacionesChat)) {
  615. $this->participacionesChat[] = $participacionesChat;
  616. $participacionesChat->setUsuario($this);
  617. }
  618. return $this;
  619. }
  620. public function removeParticipacionesChat(Participante $participacionesChat): self
  621. {
  622. if ($this->participacionesChat->contains($participacionesChat)) {
  623. $this->participacionesChat->removeElement($participacionesChat);
  624. // set the owning side to null (unless already changed)
  625. if ($participacionesChat->getUsuario() === $this) {
  626. $participacionesChat->setUsuario(null);
  627. }
  628. }
  629. return $this;
  630. }
  631. /**
  632. * @return Collection|Seguidor[]
  633. */
  634. public function getSeguidos(): Collection
  635. {
  636. return $this->seguidos;
  637. }
  638. public function addSeguido(Seguidor $seguido): self
  639. {
  640. if (!$this->seguidos->contains($seguido)) {
  641. $this->seguidos[] = $seguido;
  642. $seguido->setSeguidor($this);
  643. }
  644. return $this;
  645. }
  646. public function removeSeguido(Seguidor $seguido): self
  647. {
  648. if ($this->seguidos->contains($seguido)) {
  649. $this->seguidos->removeElement($seguido);
  650. // set the owning side to null (unless already changed)
  651. if ($seguido->getSeguidor() === $this) {
  652. $seguido->setSeguidor(null);
  653. }
  654. }
  655. return $this;
  656. }
  657. /**
  658. * @return Collection|Seguidor[]
  659. */
  660. public function getSeguidores(): Collection
  661. {
  662. return $this->seguidores;
  663. }
  664. public function addSeguidor(Seguidor $seguidore): self
  665. {
  666. if (!$this->seguidores->contains($seguidore)) {
  667. $this->seguidores[] = $seguidore;
  668. $seguidore->setSeguido($this);
  669. }
  670. return $this;
  671. }
  672. public function removeSeguidor(Seguidor $seguidore): self
  673. {
  674. if ($this->seguidores->contains($seguidore)) {
  675. $this->seguidores->removeElement($seguidore);
  676. // set the owning side to null (unless already changed)
  677. if ($seguidore->getSeguido() === $this) {
  678. $seguidore->setSeguido(null);
  679. }
  680. }
  681. return $this;
  682. }
  683. /**
  684. * @return Collection|Bloqueos[]
  685. */
  686. public function getBloqueados(): Collection
  687. {
  688. return $this->bloqueados;
  689. }
  690. public function addBloqueado(Bloqueos $bloqueado): self
  691. {
  692. if (!$this->bloqueados->contains($bloqueado)) {
  693. $this->bloqueados[] = $bloqueado;
  694. $bloqueado->setBloqueador($this);
  695. }
  696. return $this;
  697. }
  698. public function removeBloqueado(Bloqueos $bloqueado): self
  699. {
  700. if ($this->bloqueados->removeElement($bloqueado)) {
  701. // set the owning side to null (unless already changed)
  702. if ($bloqueado->getBloqueador() === $this) {
  703. $bloqueado->setBloqueador(null);
  704. }
  705. }
  706. return $this;
  707. }
  708. /**
  709. * @return Collection|Bloqueos[]
  710. */
  711. public function getBloqueadores(): Collection
  712. {
  713. return $this->bloqueadores;
  714. }
  715. public function addBloqueadore(Bloqueos $bloqueadore): self
  716. {
  717. if (!$this->bloqueadores->contains($bloqueadore)) {
  718. $this->bloqueadores[] = $bloqueadore;
  719. $bloqueadore->setBloqueado($this);
  720. }
  721. return $this;
  722. }
  723. public function removeBloqueadore(Bloqueos $bloqueadore): self
  724. {
  725. if ($this->bloqueadores->removeElement($bloqueadore)) {
  726. // set the owning side to null (unless already changed)
  727. if ($bloqueadore->getBloqueado() === $this) {
  728. $bloqueadore->setBloqueado(null);
  729. }
  730. }
  731. return $this;
  732. }
  733. public function getCreatedAt(): ?\DateTimeInterface
  734. {
  735. return $this->createdAt;
  736. }
  737. public function setCreatedAt(\DateTimeInterface $createdAt): self
  738. {
  739. $this->createdAt = $createdAt;
  740. return $this;
  741. }
  742. /**
  743. * @return Collection|CybersourceTransLog[]
  744. */
  745. public function getCybersourceTransLogs(): Collection
  746. {
  747. return $this->cybersourceTransLogs;
  748. }
  749. public function addCybersourceTransLog(CybersourceTransLog $cybersourceTransLog): self
  750. {
  751. if (!$this->cybersourceTransLogs->contains($cybersourceTransLog)) {
  752. $this->cybersourceTransLogs[] = $cybersourceTransLog;
  753. $cybersourceTransLog->setUser($this);
  754. }
  755. return $this;
  756. }
  757. public function removeCybersourceTransLog(CybersourceTransLog $cybersourceTransLog): self
  758. {
  759. if ($this->cybersourceTransLogs->removeElement($cybersourceTransLog)) {
  760. // set the owning side to null (unless already changed)
  761. if ($cybersourceTransLog->getUser() === $this) {
  762. $cybersourceTransLog->setUser(null);
  763. }
  764. }
  765. return $this;
  766. }
  767. public function getTokenConfirmarEmail(): ?string
  768. {
  769. return $this->tokenConfirmarEmail;
  770. }
  771. public function setTokenConfirmarEmail(?string $tokenConfirmarEmail): self
  772. {
  773. $this->tokenConfirmarEmail = $tokenConfirmarEmail;
  774. return $this;
  775. }
  776. public function getTokenRecuperarPassword(): ?string
  777. {
  778. return $this->tokenRecuperarPassword;
  779. }
  780. public function setTokenRecuperarPassword(?string $tokenRecuperarPassword): self
  781. {
  782. $this->tokenRecuperarPassword = $tokenRecuperarPassword;
  783. return $this;
  784. }
  785. public function getEmailConfirmado(): ?bool
  786. {
  787. return $this->emailConfirmado;
  788. }
  789. public function setEmailConfirmado(bool $emailConfirmado): self
  790. {
  791. $this->emailConfirmado = $emailConfirmado;
  792. return $this;
  793. }
  794. public function getDebitoAutomatico(): ?bool
  795. {
  796. return $this->debitoAutomatico;
  797. }
  798. public function setDebitoAutomatico(bool $debitoAutomatico): self
  799. {
  800. $this->debitoAutomatico = $debitoAutomatico;
  801. return $this;
  802. }
  803. public function getTokenCybersource(): ?string
  804. {
  805. return $this->tokenCybersource;
  806. }
  807. public function setTokenCybersource(?string $tokenCybersource): self
  808. {
  809. $this->tokenCybersource = $tokenCybersource;
  810. return $this;
  811. }
  812. public function getDirector(): ?Director
  813. {
  814. return $this->director;
  815. }
  816. public function setDirector(Director $director): self
  817. {
  818. // set the owning side of the relation if necessary
  819. if ($director->getUser() !== $this) {
  820. $director->setUser($this);
  821. }
  822. $this->director = $director;
  823. return $this;
  824. }
  825. public function getCodigoNumeroTelefonico() {
  826. return $this->paisCodigoTelefonico->getCodigoTelefonico();
  827. }
  828. public function getPaisCodigoNumeroTelefonico() {
  829. return $this->paisCodigoTelefonico;
  830. }
  831. public function setPaisCodigoTelefonico(Country $paisCodigo): self {
  832. $this->paisCodigoTelefonico = $paisCodigo;
  833. return $this;
  834. }
  835. /**
  836. * @return Collection|TutorialUsuario[]
  837. */
  838. public function getTutorialesUsuario(): Collection
  839. {
  840. return $this->tutorialesUsuario;
  841. }
  842. public function addTutorialesUsuario(TutorialUsuario $tutorialesUsuario): self
  843. {
  844. if (!$this->tutorialesUsuario->contains($tutorialesUsuario)) {
  845. $this->tutorialesUsuario[] = $tutorialesUsuario;
  846. $tutorialesUsuario->setUser($this);
  847. }
  848. return $this;
  849. }
  850. public function removeTutorialesUsuario(TutorialUsuario $tutorialesUsuario): self
  851. {
  852. if ($this->tutorialesUsuario->removeElement($tutorialesUsuario)) {
  853. // set the owning side to null (unless already changed)
  854. if ($tutorialesUsuario->getUser() === $this) {
  855. $tutorialesUsuario->setUser(null);
  856. }
  857. }
  858. return $this;
  859. }
  860. /**
  861. * @return Collection|Notificacion[]
  862. */
  863. public function getNotificacionesNoVistas(): Collection
  864. {
  865. $notificacionesNoVistas = new ArrayCollection();
  866. for ($i = 0; $i < $this->notificaciones->count(); $i++) {
  867. /** @var Notificacion $notificacion */
  868. $notificacion = $this->notificaciones->get($i);
  869. if (!$notificacion->getVista()) {
  870. $notificacionesNoVistas->add($notificacion);
  871. }
  872. }
  873. return $notificacionesNoVistas;
  874. }
  875. /**
  876. * @return Collection|Notificacion[]
  877. */
  878. public function getNotificaciones(): Collection
  879. {
  880. return $this->notificaciones;
  881. }
  882. public function getCalendario(): ?Calendario
  883. {
  884. return $this->calendario;
  885. }
  886. public function setCalendario(?Calendario $calendario): self
  887. {
  888. $this->calendario = $calendario;
  889. return $this;
  890. }
  891. }