src/Entity/PropietarioContenido.php line 33

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Enum\ComarcaEnum;
  4. use App\Enum\RolEnum;
  5. use App\Validator as ConforcatAssert;
  6. use DateTime;
  7. use Doctrine\Common\Collections\ArrayCollection;
  8. use Doctrine\Common\Collections\Collection;
  9. use Doctrine\DBAL\Types\Types;
  10. use Doctrine\ORM\Mapping as ORM;
  11. use Gedmo\Mapping\Annotation as Gedmo;
  12. use Symfony\Component\HttpFoundation\File\File;
  13. use Vich\UploaderBundle\Mapping\Annotation as Vich;
  14. /**
  15. * @ORM\Entity
  16. * @ORM\Table(name="propietario_contenido")
  17. * @ORM\InheritanceType("SINGLE_TABLE")
  18. * @ORM\DiscriminatorColumn(name="type", type="string")
  19. * @ORM\DiscriminatorMap({
  20. * "propietario_contenido":"App\Entity\PropietarioContenido",
  21. * "participante":"App\Entity\Participante",
  22. * "formador":"App\Entity\Formador",
  23. * "empresa":"App\Entity\EmpresaPropietarioContenido",
  24. * "entidad_representativa":"App\Entity\EntidadRepresentativaPropietarioContenido",
  25. * "consorci":"App\Entity\ConsorciPropietarioContenido",
  26. * "entidad_colaboradora":"App\Entity\EntidadColaboradoraPropietarioContenido"
  27. * })
  28. */
  29. #[Vich\Uploadable]
  30. abstract class PropietarioContenido extends BaseEntity
  31. {
  32. /**
  33. * @ORM\Id
  34. * @ORM\Column(type="integer")
  35. * @ORM\GeneratedValue(strategy="AUTO")
  36. */
  37. protected $id;
  38. /**
  39. * @ORM\Column(type="string", nullable=true)
  40. */
  41. protected $nombre;
  42. /**
  43. * @ORM\Column(type="string", nullable=true)
  44. */
  45. protected $apellidos;
  46. /**
  47. * @ORM\Column(type="string", nullable=true, name="nombre_sentido")
  48. */
  49. private $nombreSentido;
  50. /**
  51. * @ORM\Column(type="string", nullable=true, options={"comment":"NĂºmero de la Seguridad Social"})
  52. */
  53. private $nss;
  54. /**
  55. * @ORM\Column(type="string", nullable=true)
  56. */
  57. protected $correo;
  58. /**
  59. * @ORM\Column(type="integer", nullable=true, name="tipo_via")
  60. */
  61. private $tipoVia;
  62. /**
  63. * @ORM\Column(type="string", nullable=true)
  64. */
  65. protected $direccion;
  66. /**
  67. * @ORM\Column(type="string", nullable=true)
  68. */
  69. private $numero;
  70. /**
  71. * @ORM\Column(type="string", nullable=true)
  72. */
  73. private $escalera;
  74. /**
  75. * @ORM\Column(type="string", nullable=true)
  76. */
  77. private $planta;
  78. /**
  79. * @ORM\Column(type="string", nullable=true)
  80. */
  81. private $puerta;
  82. /**
  83. * @ORM\Column(type="string", nullable=true)
  84. */
  85. private $piso;
  86. /**
  87. * @ORM\Column(type="string", nullable=true)
  88. */
  89. private $cp;
  90. /**
  91. * @ORM\Column(type="string", nullable=true)
  92. */
  93. private $poblacion;
  94. /**
  95. * @ORM\Column(type="string", nullable=true, enumType="App\Enum\ComarcaEnum")
  96. */
  97. private $comarca;
  98. /**
  99. * @ORM\Column(type="string", nullable=true)
  100. */
  101. private $provincia;
  102. /**
  103. * @ORM\Column(type="string", nullable=true)
  104. */
  105. private $pais;
  106. /**
  107. * @ORM\Column(type="string", nullable=true)
  108. */
  109. protected $telefonos;
  110. /**
  111. * @ORM\Column(type="boolean", nullable=true, options={"default":1})
  112. */
  113. protected $activo=1;
  114. /**
  115. * @ORM\Column(type="json", nullable=true, name="preferencias_notificaciones")
  116. */
  117. protected $preferenciasNotificaciones;
  118. /**
  119. * @ORM\Column(type="boolean", nullable=true, name="info_public")
  120. */
  121. private $infoPublic;
  122. /**
  123. * @ORM\Column(type="boolean", nullable=true, name="intercambio_mensajes", options={"default":1})
  124. */
  125. private $intercambioMensajes = true;
  126. /**
  127. * @ORM\Column(type="string", nullable=true, name="id_externo")
  128. */
  129. protected $idExterno;
  130. /**
  131. * @ORM\Column(type="string", nullable=true)
  132. */
  133. protected $foto;
  134. /**
  135. * @var File
  136. */
  137. #[Vich\UploadableField(mapping: 'propietario', fileNameProperty: 'foto')]
  138. protected $fotoFile;
  139. /**
  140. * @ORM\Column(type="string", nullable=true, name="tipo_identificador")
  141. */
  142. private $tipoIdentificador;
  143. /**
  144. * @ConforcatAssert\ConstraintIdentidad()
  145. * @ORM\Column(type="string", nullable=true, options={"comment":"siendo el dni, cif, nif, nie, etc ... "})
  146. */
  147. private $identificador;
  148. /**
  149. * @ORM\Column(type="string", nullable=true)
  150. */
  151. private $razonSocial;
  152. /**
  153. * @ORM\Column(type="datetime", nullable=true, name="deleted_at")
  154. */
  155. protected $deletedAt;
  156. /**
  157. * @ORM\Column(type="datetime", nullable=false, name="updated_at", options={"default":"2024-01-01 00:00:00"})
  158. * @Gedmo\Timestampable(on="update")
  159. */
  160. protected $updatedAt;
  161. /**
  162. * @ORM\Column(type="datetime", nullable=false, name="created_at", options={"default":"2024-01-01 00:00:00"})
  163. * @Gedmo\Timestampable(on="create")
  164. */
  165. protected $createdAt;
  166. /**
  167. * @deprecated Utilizar la propiedad identificador
  168. * @ORM\Column(
  169. * type="string",
  170. * nullable=true,
  171. * options={"default":"Deprecated utilizar identificador","comment":"Deprecated utilizar identificador"}
  172. * )
  173. */
  174. protected $nif;
  175. /**
  176. * @ORM\Column(type="string", nullable=true)
  177. */
  178. private $token;
  179. /**
  180. * @ORM\Column(type="boolean", nullable=true, name="alert_fill_profile", options={"default":1})
  181. */
  182. private $alertFillProfile;
  183. /**
  184. * @ORM\OneToMany(
  185. * targetEntity=\App\Entity\PropietarioContenidoHasUsuarioHermes::class,
  186. * mappedBy="propietarioContenido"
  187. * )
  188. */
  189. private $propietarioContenidoHasUsuarioHermes;
  190. /**
  191. * @ORM\OneToMany(targetEntity=\App\Entity\Evento::class, mappedBy="propietarioContenidoEmisor")
  192. */
  193. private $eventos;
  194. /**
  195. * @ORM\OneToMany(targetEntity=\App\Entity\Formulario::class, mappedBy="propietarioContenidoEmisor")
  196. */
  197. private $formulariosEmisor;
  198. /**
  199. * @ORM\OneToMany(targetEntity=\App\Entity\FormularioRespuestas::class, mappedBy="propietarioContenido")
  200. */
  201. private $formularioRespuestas;
  202. /**
  203. * @ORM\OneToMany(targetEntity=\App\Entity\FormularioRespuestas::class, mappedBy="aprobador1")
  204. */
  205. private $formularioRespuestasAprobador1;
  206. /**
  207. * @ORM\OneToMany(targetEntity=\App\Entity\FormularioRespuestas::class, mappedBy="aprobador2")
  208. */
  209. private $formularioRespuestasAprobador2;
  210. /**
  211. * @ORM\OneToMany(targetEntity=\App\Entity\FormularioRespuestas::class, mappedBy="aprobador3")
  212. */
  213. private $formularioRespuestasAprobador3;
  214. /**
  215. * @ORM\OneToMany(targetEntity=\App\Entity\Tema::class, mappedBy="propietarioContenido")
  216. */
  217. private $temas;
  218. /**
  219. * @ORM\OneToMany(targetEntity=\App\Entity\MensajeForo::class, mappedBy="propietarioContenido")
  220. */
  221. private $mensajeForos;
  222. /**
  223. * @ORM\OneToMany(targetEntity=\App\Entity\Comunicacion::class, mappedBy="propietarioContenidoEmisor")
  224. */
  225. private $comunicacions;
  226. /**
  227. * @ORM\OneToMany(targetEntity=\App\Entity\Aviso::class, mappedBy="propietarioContenido")
  228. */
  229. private $avisos;
  230. /**
  231. * @ORM\OneToMany(targetEntity=\App\Entity\Reserva::class, mappedBy="propietarioContenidoAutoriza")
  232. */
  233. private $reservasAutoriza;
  234. /**
  235. * @ORM\OneToMany(targetEntity=\App\Entity\BuenaPractica::class, mappedBy="creador")
  236. */
  237. private $buenasPracticas;
  238. /**
  239. * @ORM\ManyToMany(targetEntity=\App\Entity\Comunicacion::class, mappedBy="propietarioContenidosDestinatarios")
  240. */
  241. private $comunicacionsDestinatarios;
  242. /**
  243. * @ORM\ManyToMany(targetEntity=\App\Entity\Reserva::class, mappedBy="propietarioContenidos")
  244. */
  245. private $reservas;
  246. public function __construct()
  247. {
  248. $this->propietarioContenidoHasUsuarioHermes = new ArrayCollection();
  249. $this->formulariosEmisor = new ArrayCollection();
  250. $this->formularioRespuestas = new ArrayCollection();
  251. $this->formularioRespuestasAprobador1 = new ArrayCollection();
  252. $this->formularioRespuestasAprobador2 = new ArrayCollection();
  253. $this->formularioRespuestasAprobador3 = new ArrayCollection();
  254. $this->temas = new ArrayCollection();
  255. $this->mensajeForos = new ArrayCollection();
  256. $this->comunicacions = new ArrayCollection();
  257. $this->avisos = new ArrayCollection();
  258. $this->reservasAutoriza = new ArrayCollection();
  259. $this->comunicacionsDestinatarios = new ArrayCollection();
  260. $this->reservas = new ArrayCollection();
  261. $this->buenasPracticas = new ArrayCollection();
  262. $this->eventos = new ArrayCollection();
  263. }
  264. public function getId(): ?int
  265. {
  266. return $this->id;
  267. }
  268. public function setId($id)
  269. {
  270. $this->id = $id;
  271. return $this;
  272. }
  273. public function getFoto(): ?string
  274. {
  275. return $this->foto;
  276. }
  277. public function setFoto(?string $foto): static
  278. {
  279. $this->foto = $foto;
  280. return $this;
  281. }
  282. public function getFotoFile(): ?File
  283. {
  284. return $this->fotoFile;
  285. }
  286. public function setFotoFile(?File $fotoFile): self
  287. {
  288. $this->fotoFile = $fotoFile;
  289. if ($fotoFile) {
  290. $this->setUpdatedAt(new DateTime('now'));
  291. }
  292. return $this;
  293. }
  294. public function getNombre(): ?string
  295. {
  296. return $this->nombre;
  297. }
  298. public function setNombre(?string $nombre): static
  299. {
  300. $this->nombre = $nombre;
  301. return $this;
  302. }
  303. public function getApellidos(): ?string
  304. {
  305. return $this->apellidos;
  306. }
  307. public function setApellidos(?string $apellidos): static
  308. {
  309. $this->apellidos = $apellidos;
  310. return $this;
  311. }
  312. public function getCorreo(): ?string
  313. {
  314. return $this->correo;
  315. }
  316. public function setCorreo(?string $correo): static
  317. {
  318. $this->correo = $correo;
  319. return $this;
  320. }
  321. public function getDireccion(): ?string
  322. {
  323. return $this->direccion;
  324. }
  325. public function setDireccion(?string $direccion): static
  326. {
  327. $this->direccion = $direccion;
  328. return $this;
  329. }
  330. public function getTelefonos(): ?string
  331. {
  332. return $this->telefonos;
  333. }
  334. public function setTelefonos(?string $telefonos): static
  335. {
  336. $this->telefonos = $telefonos;
  337. return $this;
  338. }
  339. public function isActivo(): ?bool
  340. {
  341. return $this->activo;
  342. }
  343. public function setActivo(?bool $activo): static
  344. {
  345. $this->activo = $activo;
  346. return $this;
  347. }
  348. public function getPreferenciasNotificaciones(): ?array
  349. {
  350. return $this->preferenciasNotificaciones;
  351. }
  352. public function setPreferenciasNotificaciones(?array $preferenciasNotificaciones): static
  353. {
  354. $this->preferenciasNotificaciones = $preferenciasNotificaciones;
  355. return $this;
  356. }
  357. public function getIdExterno(): ?string
  358. {
  359. if (!$this->idExterno) {
  360. return RolEnum::getRolFromClass(get_class($this))."::".$this->getNif();
  361. }
  362. return $this->idExterno;
  363. }
  364. public function setIdExterno(?string $idExterno): static
  365. {
  366. $this->idExterno = $idExterno;
  367. return $this;
  368. }
  369. public function getDeletedAt(): ?\DateTimeInterface
  370. {
  371. return $this->deletedAt;
  372. }
  373. public function setDeletedAt(?\DateTimeInterface $deletedAt): static
  374. {
  375. $this->deletedAt = $deletedAt;
  376. return $this;
  377. }
  378. public function getUpdatedAt(): ?\DateTimeInterface
  379. {
  380. return $this->updatedAt;
  381. }
  382. public function setUpdatedAt(\DateTimeInterface $updatedAt): static
  383. {
  384. $this->updatedAt = $updatedAt;
  385. return $this;
  386. }
  387. public function getCreatedAt(): ?\DateTimeInterface
  388. {
  389. return $this->createdAt;
  390. }
  391. public function setCreatedAt(\DateTimeInterface $createdAt): static
  392. {
  393. $this->createdAt = $createdAt;
  394. return $this;
  395. }
  396. /**
  397. * @deprecated Utilizar el método getIdenficador()
  398. * @return string|null
  399. */
  400. public function getNif(): ?string
  401. {
  402. if (!$this->nif) return $this->getIdentificador();
  403. return $this->nif;
  404. }
  405. /**
  406. * @deprecated Utilizar el método setIdentificador()
  407. * @param string|null $nif
  408. * @return $this
  409. */
  410. public function setNif(?string $nif): static
  411. {
  412. $this->nif = $nif;
  413. return $this;
  414. }
  415. public function getToken(): ?string
  416. {
  417. return $this->token;
  418. }
  419. public function setToken(?string $token): static
  420. {
  421. $this->token = $token;
  422. return $this;
  423. }
  424. /**
  425. * @return Collection<int, PropietarioContenidoHasUsuarioHermes>
  426. */
  427. public function getPropietarioContenidoHasUsuarioHermes(): Collection
  428. {
  429. return $this->propietarioContenidoHasUsuarioHermes;
  430. }
  431. public function addPropietarioContenidoHasUsuarioHerme(PropietarioContenidoHasUsuarioHermes $propietarioContenidoHasUsuarioHerme): static
  432. {
  433. if (!$this->propietarioContenidoHasUsuarioHermes->contains($propietarioContenidoHasUsuarioHerme)) {
  434. $this->propietarioContenidoHasUsuarioHermes->add($propietarioContenidoHasUsuarioHerme);
  435. $propietarioContenidoHasUsuarioHerme->setPropietarioContenido($this);
  436. }
  437. return $this;
  438. }
  439. public function removePropietarioContenidoHasUsuarioHerme(PropietarioContenidoHasUsuarioHermes $propietarioContenidoHasUsuarioHerme): static
  440. {
  441. if ($this->propietarioContenidoHasUsuarioHermes->removeElement($propietarioContenidoHasUsuarioHerme)) {
  442. // set the owning side to null (unless already changed)
  443. if ($propietarioContenidoHasUsuarioHerme->getPropietarioContenido() === $this) {
  444. $propietarioContenidoHasUsuarioHerme->setPropietarioContenido(null);
  445. }
  446. }
  447. return $this;
  448. }
  449. /**
  450. * @return Collection<int, Formulario>
  451. */
  452. public function getFormulariosEmisor(): Collection
  453. {
  454. return $this->formulariosEmisor;
  455. }
  456. public function addFormulariosEmisor(Formulario $formulariosEmisor): static
  457. {
  458. if (!$this->formulariosEmisor->contains($formulariosEmisor)) {
  459. $this->formulariosEmisor->add($formulariosEmisor);
  460. $formulariosEmisor->setPropietarioContenidoEmisor($this);
  461. }
  462. return $this;
  463. }
  464. public function removeFormulariosEmisor(Formulario $formulariosEmisor): static
  465. {
  466. if ($this->formulariosEmisor->removeElement($formulariosEmisor)) {
  467. // set the owning side to null (unless already changed)
  468. if ($formulariosEmisor->getPropietarioContenidoEmisor() === $this) {
  469. $formulariosEmisor->setPropietarioContenidoEmisor(null);
  470. }
  471. }
  472. return $this;
  473. }
  474. /**
  475. * @return Collection<int, FormularioRespuestas>
  476. */
  477. public function getFormularioRespuestas(): Collection
  478. {
  479. return $this->formularioRespuestas;
  480. }
  481. public function addFormularioRespuesta(FormularioRespuestas $formularioRespuesta): static
  482. {
  483. if (!$this->formularioRespuestas->contains($formularioRespuesta)) {
  484. $this->formularioRespuestas->add($formularioRespuesta);
  485. $formularioRespuesta->setPropietarioContenido($this);
  486. }
  487. return $this;
  488. }
  489. public function removeFormularioRespuesta(FormularioRespuestas $formularioRespuesta): static
  490. {
  491. if ($this->formularioRespuestas->removeElement($formularioRespuesta)) {
  492. // set the owning side to null (unless already changed)
  493. if ($formularioRespuesta->getPropietarioContenido() === $this) {
  494. $formularioRespuesta->setPropietarioContenido(null);
  495. }
  496. }
  497. return $this;
  498. }
  499. /**
  500. * @return Collection<int, FormularioRespuestas>
  501. */
  502. public function getFormularioRespuestasAprobador1(): Collection
  503. {
  504. return $this->formularioRespuestasAprobador1;
  505. }
  506. public function addFormularioRespuestasAprobador1(FormularioRespuestas $formularioRespuestasAprobador1): static
  507. {
  508. if (!$this->formularioRespuestasAprobador1->contains($formularioRespuestasAprobador1)) {
  509. $this->formularioRespuestasAprobador1->add($formularioRespuestasAprobador1);
  510. $formularioRespuestasAprobador1->setAprobador1($this);
  511. }
  512. return $this;
  513. }
  514. public function removeFormularioRespuestasAprobador1(FormularioRespuestas $formularioRespuestasAprobador1): static
  515. {
  516. if ($this->formularioRespuestasAprobador1->removeElement($formularioRespuestasAprobador1)) {
  517. // set the owning side to null (unless already changed)
  518. if ($formularioRespuestasAprobador1->getAprobador1() === $this) {
  519. $formularioRespuestasAprobador1->setAprobador1(null);
  520. }
  521. }
  522. return $this;
  523. }
  524. /**
  525. * @return Collection<int, FormularioRespuestas>
  526. */
  527. public function getFormularioRespuestasAprobador2(): Collection
  528. {
  529. return $this->formularioRespuestasAprobador2;
  530. }
  531. public function addFormularioRespuestasAprobador2(FormularioRespuestas $formularioRespuestasAprobador2): static
  532. {
  533. if (!$this->formularioRespuestasAprobador2->contains($formularioRespuestasAprobador2)) {
  534. $this->formularioRespuestasAprobador2->add($formularioRespuestasAprobador2);
  535. $formularioRespuestasAprobador2->setAprobador2($this);
  536. }
  537. return $this;
  538. }
  539. public function removeFormularioRespuestasAprobador2(FormularioRespuestas $formularioRespuestasAprobador2): static
  540. {
  541. if ($this->formularioRespuestasAprobador2->removeElement($formularioRespuestasAprobador2)) {
  542. // set the owning side to null (unless already changed)
  543. if ($formularioRespuestasAprobador2->getAprobador2() === $this) {
  544. $formularioRespuestasAprobador2->setAprobador2(null);
  545. }
  546. }
  547. return $this;
  548. }
  549. /**
  550. * @return Collection<int, FormularioRespuestas>
  551. */
  552. public function getFormularioRespuestasAprobador3(): Collection
  553. {
  554. return $this->formularioRespuestasAprobador3;
  555. }
  556. public function addFormularioRespuestasAprobador3(FormularioRespuestas $formularioRespuestasAprobador3): static
  557. {
  558. if (!$this->formularioRespuestasAprobador3->contains($formularioRespuestasAprobador3)) {
  559. $this->formularioRespuestasAprobador3->add($formularioRespuestasAprobador3);
  560. $formularioRespuestasAprobador3->setAprobador3($this);
  561. }
  562. return $this;
  563. }
  564. public function removeFormularioRespuestasAprobador3(FormularioRespuestas $formularioRespuestasAprobador3): static
  565. {
  566. if ($this->formularioRespuestasAprobador3->removeElement($formularioRespuestasAprobador3)) {
  567. // set the owning side to null (unless already changed)
  568. if ($formularioRespuestasAprobador3->getAprobador3() === $this) {
  569. $formularioRespuestasAprobador3->setAprobador3(null);
  570. }
  571. }
  572. return $this;
  573. }
  574. public function getNss(): ?string
  575. {
  576. return $this->nss;
  577. }
  578. public function setNss(?string $nss): static
  579. {
  580. $this->nss = $nss;
  581. return $this;
  582. }
  583. public function getNumero(): ?string
  584. {
  585. return $this->numero;
  586. }
  587. public function setNumero(?string $numero): static
  588. {
  589. $this->numero = $numero;
  590. return $this;
  591. }
  592. public function getEscalera(): ?string
  593. {
  594. return $this->escalera;
  595. }
  596. public function setEscalera(?string $escalera): static
  597. {
  598. $this->escalera = $escalera;
  599. return $this;
  600. }
  601. public function getPlanta(): ?string
  602. {
  603. return $this->planta;
  604. }
  605. public function setPlanta(?string $planta): static
  606. {
  607. $this->planta = $planta;
  608. return $this;
  609. }
  610. public function getPuerta(): ?string
  611. {
  612. return $this->puerta;
  613. }
  614. public function setPuerta(?string $puerta): static
  615. {
  616. $this->puerta = $puerta;
  617. return $this;
  618. }
  619. public function getPiso(): ?string
  620. {
  621. return $this->piso;
  622. }
  623. public function setPiso(?string $piso): static
  624. {
  625. $this->piso = $piso;
  626. return $this;
  627. }
  628. public function getCp(): ?string
  629. {
  630. return $this->cp;
  631. }
  632. public function setCp(?string $cp): static
  633. {
  634. $this->cp = $cp;
  635. return $this;
  636. }
  637. public function getPoblacion(): ?string
  638. {
  639. return $this->poblacion;
  640. }
  641. public function setPoblacion(?string $poblacion): static
  642. {
  643. $this->poblacion = $poblacion;
  644. return $this;
  645. }
  646. public function getProvincia(): ?string
  647. {
  648. return $this->provincia;
  649. }
  650. public function setProvincia(?string $provincia): static
  651. {
  652. $this->provincia = $provincia;
  653. return $this;
  654. }
  655. public function getPais(): ?string
  656. {
  657. return $this->pais;
  658. }
  659. public function setPais(?string $pais): static
  660. {
  661. $this->pais = $pais;
  662. return $this;
  663. }
  664. public function isInfoPublic(): ?bool
  665. {
  666. return $this->infoPublic;
  667. }
  668. public function setInfoPublic(?bool $infoPublic): static
  669. {
  670. $this->infoPublic = $infoPublic;
  671. return $this;
  672. }
  673. public function getIntercambioMensajes(): ?bool
  674. {
  675. return $this->intercambioMensajes;
  676. }
  677. public function setIntercambioMensajes(?bool $intercambioMensajes): static
  678. {
  679. $this->intercambioMensajes = $intercambioMensajes;
  680. return $this;
  681. }
  682. public function getTipoIdentificador(): ?string
  683. {
  684. return $this->tipoIdentificador;
  685. }
  686. public function setTipoIdentificador(?string $tipoIdentificador): static
  687. {
  688. $this->tipoIdentificador = $tipoIdentificador;
  689. return $this;
  690. }
  691. public function getIdentificador(): ?string
  692. {
  693. return $this->identificador;
  694. }
  695. public function setIdentificador(?string $identificador): static
  696. {
  697. $this->identificador = $identificador;
  698. return $this;
  699. }
  700. public function getRazonSocial(): ?string
  701. {
  702. return $this->razonSocial;
  703. }
  704. public function setRazonSocial(?string $razonSocial): static
  705. {
  706. $this->razonSocial = $razonSocial;
  707. return $this;
  708. }
  709. /**
  710. * @return Collection<int, Tema>
  711. */
  712. public function getTemas(): Collection
  713. {
  714. return $this->temas;
  715. }
  716. public function addTema(Tema $tema): static
  717. {
  718. if (!$this->temas->contains($tema)) {
  719. $this->temas->add($tema);
  720. $tema->setPropietarioContenido($this);
  721. }
  722. return $this;
  723. }
  724. public function removeTema(Tema $tema): static
  725. {
  726. if ($this->temas->removeElement($tema)) {
  727. // set the owning side to null (unless already changed)
  728. if ($tema->getPropietarioContenido() === $this) {
  729. $tema->setPropietarioContenido(null);
  730. }
  731. }
  732. return $this;
  733. }
  734. /**
  735. * @return Collection<int, MensajeForo>
  736. */
  737. public function getMensajeForos(): Collection
  738. {
  739. return $this->mensajeForos;
  740. }
  741. public function addMensajeForo(MensajeForo $mensajeForo): static
  742. {
  743. if (!$this->mensajeForos->contains($mensajeForo)) {
  744. $this->mensajeForos->add($mensajeForo);
  745. $mensajeForo->setPropietarioContenido($this);
  746. }
  747. return $this;
  748. }
  749. public function removeMensajeForo(MensajeForo $mensajeForo): static
  750. {
  751. if ($this->mensajeForos->removeElement($mensajeForo)) {
  752. // set the owning side to null (unless already changed)
  753. if ($mensajeForo->getPropietarioContenido() === $this) {
  754. $mensajeForo->setPropietarioContenido(null);
  755. }
  756. }
  757. return $this;
  758. }
  759. /**
  760. * @return Collection<int, Comunicacion>
  761. */
  762. public function getComunicacions(): Collection
  763. {
  764. return $this->comunicacions;
  765. }
  766. public function addComunicacion(Comunicacion $comunicacion): static
  767. {
  768. if (!$this->comunicacions->contains($comunicacion)) {
  769. $this->comunicacions->add($comunicacion);
  770. $comunicacion->setPropietarioContenidoEmisor($this);
  771. }
  772. return $this;
  773. }
  774. public function removeComunicacion(Comunicacion $comunicacion): static
  775. {
  776. if ($this->comunicacions->removeElement($comunicacion)) {
  777. // set the owning side to null (unless already changed)
  778. if ($comunicacion->getPropietarioContenidoEmisor() === $this) {
  779. $comunicacion->setPropietarioContenidoEmisor(null);
  780. }
  781. }
  782. return $this;
  783. }
  784. /**
  785. * @return Collection<int, Aviso>
  786. */
  787. public function getAvisos(): Collection
  788. {
  789. return $this->avisos;
  790. }
  791. public function addAviso(Aviso $aviso): static
  792. {
  793. if (!$this->avisos->contains($aviso)) {
  794. $this->avisos->add($aviso);
  795. $aviso->setPropietarioContenido($this);
  796. }
  797. return $this;
  798. }
  799. public function removeAviso(Aviso $aviso): static
  800. {
  801. if ($this->avisos->removeElement($aviso)) {
  802. // set the owning side to null (unless already changed)
  803. if ($aviso->getPropietarioContenido() === $this) {
  804. $aviso->setPropietarioContenido(null);
  805. }
  806. }
  807. return $this;
  808. }
  809. /**
  810. * @return Collection<int, Reserva>
  811. */
  812. public function getReservasAutoriza(): Collection
  813. {
  814. return $this->reservasAutoriza;
  815. }
  816. public function addReservasAutoriza(Reserva $reservasAutoriza): static
  817. {
  818. if (!$this->reservasAutoriza->contains($reservasAutoriza)) {
  819. $this->reservasAutoriza->add($reservasAutoriza);
  820. $reservasAutoriza->setPropietarioContenidoAutoriza($this);
  821. }
  822. return $this;
  823. }
  824. public function removeReservasAutoriza(Reserva $reservasAutoriza): static
  825. {
  826. if ($this->reservasAutoriza->removeElement($reservasAutoriza)) {
  827. // set the owning side to null (unless already changed)
  828. if ($reservasAutoriza->getPropietarioContenidoAutoriza() === $this) {
  829. $reservasAutoriza->setPropietarioContenidoAutoriza(null);
  830. }
  831. }
  832. return $this;
  833. }
  834. /**
  835. * @return Collection<int, Comunicacion>
  836. */
  837. public function getComunicacionsDestinatarios(): Collection
  838. {
  839. return $this->comunicacionsDestinatarios;
  840. }
  841. public function addComunicacionsDestinatario(Comunicacion $comunicacionsDestinatario): static
  842. {
  843. if (!$this->comunicacionsDestinatarios->contains($comunicacionsDestinatario)) {
  844. $this->comunicacionsDestinatarios->add($comunicacionsDestinatario);
  845. $comunicacionsDestinatario->addPropietarioContenidosDestinatario($this);
  846. }
  847. return $this;
  848. }
  849. public function removeComunicacionsDestinatario(Comunicacion $comunicacionsDestinatario): static
  850. {
  851. if ($this->comunicacionsDestinatarios->removeElement($comunicacionsDestinatario)) {
  852. $comunicacionsDestinatario->removePropietarioContenidosDestinatario($this);
  853. }
  854. return $this;
  855. }
  856. /**
  857. * @return Collection<int, Reserva>
  858. */
  859. public function getReservas(): Collection
  860. {
  861. return $this->reservas;
  862. }
  863. public function addReserva(Reserva $reserva): static
  864. {
  865. if (!$this->reservas->contains($reserva)) {
  866. $this->reservas->add($reserva);
  867. $reserva->addPropietarioContenido($this);
  868. }
  869. return $this;
  870. }
  871. public function removeReserva(Reserva $reserva): static
  872. {
  873. if ($this->reservas->removeElement($reserva)) {
  874. $reserva->removePropietarioContenido($this);
  875. }
  876. return $this;
  877. }
  878. public function __toString(): string
  879. {
  880. if ($this instanceof Participante or $this instanceof Formador) {
  881. return trim($this->getNombre()." ".$this->getApellidos());
  882. }
  883. return $this->nombre;
  884. }
  885. public function getIniciales(): string
  886. {
  887. $nombre = trim($this->nombre);
  888. $apellidos = trim($this->apellidos);
  889. // Extraer la primera letra del primer nombre
  890. $inicialNombre = mb_substr($nombre, 0, 1, 'UTF-8');
  891. // Extraer la primera letra del primer apellido si existe
  892. $inicialApellido = '';
  893. if (!empty($apellidos)) {
  894. $apellidosArray = explode(' ', $apellidos);
  895. $inicialApellido = mb_substr($apellidosArray[0], 0, 1, 'UTF-8');
  896. }
  897. return strtoupper($inicialNombre . $inicialApellido);
  898. }
  899. public function getUsuarioHermes(): ?UsuarioHermes
  900. {
  901. if ($this->getPropietarioContenidoHasUsuarioHermes()->count() == 0) {
  902. return null;
  903. }
  904. return $this->getPropietarioContenidoHasUsuarioHermes()->first()->getUsuarioHermes();
  905. }
  906. public function getNombreSentido(): ?string
  907. {
  908. return $this->nombreSentido;
  909. }
  910. public function setNombreSentido(?string $nombreSentido): static
  911. {
  912. $this->nombreSentido = $nombreSentido;
  913. return $this;
  914. }
  915. /**
  916. * @return Collection<int, BuenaPractica>
  917. */
  918. public function getBuenasPracticas(): Collection
  919. {
  920. return $this->buenasPracticas;
  921. }
  922. public function addBuenasPractica(BuenaPractica $buenasPractica): static
  923. {
  924. if (!$this->buenasPracticas->contains($buenasPractica)) {
  925. $this->buenasPracticas->add($buenasPractica);
  926. $buenasPractica->setCreador($this);
  927. }
  928. return $this;
  929. }
  930. public function removeBuenasPractica(BuenaPractica $buenasPractica): static
  931. {
  932. if ($this->buenasPracticas->removeElement($buenasPractica)) {
  933. // set the owning side to null (unless already changed)
  934. if ($buenasPractica->getCreador() === $this) {
  935. $buenasPractica->setCreador(null);
  936. }
  937. }
  938. return $this;
  939. }
  940. public function getEntidadAsociada()
  941. {
  942. switch (get_class($this)) {
  943. case EntidadColaboradoraPropietarioContenido::class:
  944. return $this->getEntidadColaboradora();
  945. case EntidadRepresentativaPropietarioContenido::class:
  946. return $this->getEntidadRepresentativa();
  947. case EmpresaPropietarioContenido::class:
  948. return $this->getEmpresa();
  949. case ConsorciPropietarioContenido::class:
  950. return $this->getConsorci();
  951. default:
  952. return null;
  953. }
  954. }
  955. public function getNombreCompleto()
  956. {
  957. return trim($this->nombre . ' ' . $this->apellidos) ?: 'Desconocido';
  958. }
  959. /**
  960. * @return Collection<int, Evento>
  961. */
  962. public function getEventos(): Collection
  963. {
  964. return $this->eventos;
  965. }
  966. public function addEvento(Evento $evento): static
  967. {
  968. if (!$this->eventos->contains($evento)) {
  969. $this->eventos->add($evento);
  970. $evento->setPropietarioContenidoEmisor($this);
  971. }
  972. return $this;
  973. }
  974. public function removeEvento(Evento $evento): static
  975. {
  976. if ($this->eventos->removeElement($evento)) {
  977. // set the owning side to null (unless already changed)
  978. if ($evento->getPropietarioContenidoEmisor() === $this) {
  979. $evento->setPropietarioContenidoEmisor(null);
  980. }
  981. }
  982. return $this;
  983. }
  984. public function isAlertFillProfile(): ?bool
  985. {
  986. return $this->alertFillProfile;
  987. }
  988. public function setAlertFillProfile(?bool $alertFillProfile): static
  989. {
  990. $this->alertFillProfile = $alertFillProfile;
  991. return $this;
  992. }
  993. public function getTipoVia(): ?int
  994. {
  995. return $this->tipoVia;
  996. }
  997. public function setTipoVia(?int $tipoVia): static
  998. {
  999. $this->tipoVia = $tipoVia;
  1000. return $this;
  1001. }
  1002. public function getComarca(): ?ComarcaEnum
  1003. {
  1004. return $this->comarca;
  1005. }
  1006. public function setComarca(?ComarcaEnum $comarca): static
  1007. {
  1008. $this->comarca = $comarca;
  1009. return $this;
  1010. }
  1011. }