src/Entity/CentroFormacion.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\DBAL\Types\Types;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Gedmo\Mapping\Annotation as Gedmo;
  8. /**
  9. * @ORM\Entity
  10. * @ORM\Table(name="centro_formacion")
  11. */
  12. class CentroFormacion extends \App\Entity\BaseEntity
  13. {
  14. /**
  15. * @ORM\Id
  16. * @ORM\Column(type="integer")
  17. * @ORM\GeneratedValue(strategy="AUTO")
  18. */
  19. private $id;
  20. /**
  21. * @ORM\Column(type="string", nullable=true, name="id_externo")
  22. */
  23. private $idExterno;
  24. /**
  25. * @ORM\Column(type="string", nullable=true)
  26. */
  27. private $datosContacto;
  28. /**
  29. * @ORM\Column(type="json", nullable=true)
  30. */
  31. private $geolocalizacion;
  32. /**
  33. * @ORM\Column(type="datetime", nullable=true, name="deleted_at")
  34. */
  35. private $deletedAt;
  36. /**
  37. * @ORM\Column(type="datetime", nullable=false, name="updated_at", options={"default":"2024-01-01 00:00:00"})
  38. * @Gedmo\Timestampable(on="update")
  39. */
  40. private $updatedAt;
  41. /**
  42. * @ORM\Column(type="datetime", nullable=false, name="created_at", options={"default":"2024-01-01 00:00:00"})
  43. * @Gedmo\Timestampable(on="create")
  44. */
  45. private $createdAt;
  46. /**
  47. * @ORM\OneToMany(targetEntity=\App\Entity\CentroFormacionAcogeGrupo::class, mappedBy="centroFormacion")
  48. */
  49. private $centroFormacionAcogeGrupos;
  50. /**
  51. * @ORM\ManyToOne(targetEntity=\App\Entity\Provincia::class, inversedBy="centros")
  52. * @ORM\JoinColumn(name="provincia_id", referencedColumnName="id")
  53. */
  54. private $provincia;
  55. /**
  56. * @ORM\ManyToOne(targetEntity=\App\Entity\Municipio::class, inversedBy="centros")
  57. * @ORM\JoinColumn(name="municipio_id", referencedColumnName="id")
  58. */
  59. private $municipio;
  60. /**
  61. * @ORM\ManyToMany(targetEntity=\App\Entity\UsuarioHermes::class, inversedBy="centrosFormacionFavorito")
  62. * @ORM\JoinTable(
  63. * name="registrar_favorito_centro_formacion",
  64. * joinColumns={@ORM\JoinColumn(name="centro_formacion_id", referencedColumnName="id", nullable=false)},
  65. * inverseJoinColumns={@ORM\JoinColumn(name="usuario_hermes_id", referencedColumnName="id", nullable=false)}
  66. * )
  67. */
  68. private $usuarioHermesFavorito;
  69. public function __construct()
  70. {
  71. $this->centroFormacionAcogeGrupos = new ArrayCollection();
  72. $this->usuarioHermesFavorito = new ArrayCollection();
  73. }
  74. public function getId(): ?int
  75. {
  76. return $this->id;
  77. }
  78. public function setId($id)
  79. {
  80. $this->id = $id;
  81. return $this;
  82. }
  83. public function getIdExterno(): ?string
  84. {
  85. return $this->idExterno;
  86. }
  87. public function setIdExterno(?string $idExterno): static
  88. {
  89. $this->idExterno = $idExterno;
  90. return $this;
  91. }
  92. public function getDatosContacto(): ?string
  93. {
  94. return $this->datosContacto;
  95. }
  96. public function setDatosContacto(?string $datosContacto): static
  97. {
  98. $this->datosContacto = $datosContacto;
  99. return $this;
  100. }
  101. public function getGeolocalizacion()
  102. {
  103. return $this->geolocalizacion;
  104. }
  105. public function setGeolocalizacion(?array $geolocalizacion): static
  106. {
  107. $this->geolocalizacion = $geolocalizacion;
  108. return $this;
  109. }
  110. public function getDeletedAt(): ?\DateTimeInterface
  111. {
  112. return $this->deletedAt;
  113. }
  114. public function setDeletedAt(?\DateTimeInterface $deletedAt): static
  115. {
  116. $this->deletedAt = $deletedAt;
  117. return $this;
  118. }
  119. public function getUpdatedAt(): ?\DateTimeInterface
  120. {
  121. return $this->updatedAt;
  122. }
  123. public function setUpdatedAt(\DateTimeInterface $updatedAt): static
  124. {
  125. $this->updatedAt = $updatedAt;
  126. return $this;
  127. }
  128. public function getCreatedAt(): ?\DateTimeInterface
  129. {
  130. return $this->createdAt;
  131. }
  132. public function setCreatedAt(\DateTimeInterface $createdAt): static
  133. {
  134. $this->createdAt = $createdAt;
  135. return $this;
  136. }
  137. public function getProvincia(): ?Provincia
  138. {
  139. return $this->provincia;
  140. }
  141. public function setProvincia(?Provincia $provincia): static
  142. {
  143. $this->provincia = $provincia;
  144. return $this;
  145. }
  146. public function getMunicipio(): ?Municipio
  147. {
  148. return $this->municipio;
  149. }
  150. public function setMunicipio(?Municipio $municipio): static
  151. {
  152. $this->municipio = $municipio;
  153. return $this;
  154. }
  155. /**
  156. * @return Collection<int, CentroFormacionAcogeGrupo>
  157. */
  158. public function getCentroFormacionAcogeGrupos(): Collection
  159. {
  160. return $this->centroFormacionAcogeGrupos;
  161. }
  162. public function addCentroFormacionAcogeGrupo(CentroFormacionAcogeGrupo $centroFormacionAcogeGrupo): static
  163. {
  164. if (!$this->centroFormacionAcogeGrupos->contains($centroFormacionAcogeGrupo)) {
  165. $this->centroFormacionAcogeGrupos->add($centroFormacionAcogeGrupo);
  166. $centroFormacionAcogeGrupo->setCentroFormacion($this);
  167. }
  168. return $this;
  169. }
  170. public function removeCentroFormacionAcogeGrupo(CentroFormacionAcogeGrupo $centroFormacionAcogeGrupo): static
  171. {
  172. if ($this->centroFormacionAcogeGrupos->removeElement($centroFormacionAcogeGrupo)) {
  173. // set the owning side to null (unless already changed)
  174. if ($centroFormacionAcogeGrupo->getCentroFormacion() === $this) {
  175. $centroFormacionAcogeGrupo->setCentroFormacion(null);
  176. }
  177. }
  178. return $this;
  179. }
  180. /**
  181. * @return Collection<int, UsuarioHermes>
  182. */
  183. public function getUsuarioHermesFavorito(): Collection
  184. {
  185. return $this->usuarioHermesFavorito;
  186. }
  187. public function addUsuarioHermesFavorito(UsuarioHermes $usuarioHermesFavorito): static
  188. {
  189. if (!$this->usuarioHermesFavorito->contains($usuarioHermesFavorito)) {
  190. $this->usuarioHermesFavorito->add($usuarioHermesFavorito);
  191. }
  192. return $this;
  193. }
  194. public function removeUsuarioHermesFavorito(UsuarioHermes $usuarioHermesFavorito): static
  195. {
  196. $this->usuarioHermesFavorito->removeElement($usuarioHermesFavorito);
  197. return $this;
  198. }
  199. /**
  200. * Obtiene el nombre del centro de formación (razón social)
  201. */
  202. public function getNombre(): ?string
  203. {
  204. return $this->getDataFromArray('razon_social');
  205. }
  206. /**
  207. * Obtiene la web del centro de formación
  208. */
  209. public function getWeb(): ?string
  210. {
  211. return $this->getDataFromArray('web');
  212. }
  213. /**
  214. * Obtiene el email del centro de formación
  215. */
  216. public function getEmail(): ?string
  217. {
  218. return $this->getDataFromArray('email');
  219. }
  220. /**
  221. * Obtiene el teléfono principal del centro de formación
  222. */
  223. public function getTelefono1(): ?string
  224. {
  225. return $this->getDataFromArray('telefono_1');
  226. }
  227. /**
  228. * Obtiene el teléfono secundario del centro de formación
  229. */
  230. public function getTelefono2(): ?string
  231. {
  232. return $this->getDataFromArray('telefono_2');
  233. }
  234. /**
  235. * Obtiene la latitud del centro de formación
  236. */
  237. public function getLatitud(): ?string
  238. {
  239. return $this->getDataFromArray('latitud');
  240. }
  241. /**
  242. * Obtiene la longitud del centro de formación
  243. */
  244. public function getLongitud(): ?string
  245. {
  246. return $this->getDataFromArray('longitud');
  247. }
  248. /**
  249. * Obtiene la dirección del centro de formación
  250. */
  251. public function getDireccion(): ?string
  252. {
  253. return $this->getDataFromArray('direccion');
  254. }
  255. /**
  256. * Obtiene el código postal del centro de formación
  257. */
  258. public function getCodigoPostal(): ?string
  259. {
  260. return $this->getDataFromArray('codigo_postal');
  261. }
  262. /**
  263. * Obtiene el NIF del centro de formación
  264. */
  265. public function getNif(): ?string
  266. {
  267. return $this->getDataFromArray('nif');
  268. }
  269. }