<?php
namespace App\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
/**
* @ORM\Entity
* @ORM\Table(name="centro_formacion")
*/
class CentroFormacion extends \App\Entity\BaseEntity
{
/**
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @ORM\Column(type="string", nullable=true, name="id_externo")
*/
private $idExterno;
/**
* @ORM\Column(type="string", nullable=true)
*/
private $datosContacto;
/**
* @ORM\Column(type="json", nullable=true)
*/
private $geolocalizacion;
/**
* @ORM\Column(type="datetime", nullable=true, name="deleted_at")
*/
private $deletedAt;
/**
* @ORM\Column(type="datetime", nullable=false, name="updated_at", options={"default":"2024-01-01 00:00:00"})
* @Gedmo\Timestampable(on="update")
*/
private $updatedAt;
/**
* @ORM\Column(type="datetime", nullable=false, name="created_at", options={"default":"2024-01-01 00:00:00"})
* @Gedmo\Timestampable(on="create")
*/
private $createdAt;
/**
* @ORM\OneToMany(targetEntity=\App\Entity\CentroFormacionAcogeGrupo::class, mappedBy="centroFormacion")
*/
private $centroFormacionAcogeGrupos;
/**
* @ORM\ManyToOne(targetEntity=\App\Entity\Provincia::class, inversedBy="centros")
* @ORM\JoinColumn(name="provincia_id", referencedColumnName="id")
*/
private $provincia;
/**
* @ORM\ManyToOne(targetEntity=\App\Entity\Municipio::class, inversedBy="centros")
* @ORM\JoinColumn(name="municipio_id", referencedColumnName="id")
*/
private $municipio;
/**
* @ORM\ManyToMany(targetEntity=\App\Entity\UsuarioHermes::class, inversedBy="centrosFormacionFavorito")
* @ORM\JoinTable(
* name="registrar_favorito_centro_formacion",
* joinColumns={@ORM\JoinColumn(name="centro_formacion_id", referencedColumnName="id", nullable=false)},
* inverseJoinColumns={@ORM\JoinColumn(name="usuario_hermes_id", referencedColumnName="id", nullable=false)}
* )
*/
private $usuarioHermesFavorito;
public function __construct()
{
$this->centroFormacionAcogeGrupos = new ArrayCollection();
$this->usuarioHermesFavorito = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function setId($id)
{
$this->id = $id;
return $this;
}
public function getIdExterno(): ?string
{
return $this->idExterno;
}
public function setIdExterno(?string $idExterno): static
{
$this->idExterno = $idExterno;
return $this;
}
public function getDatosContacto(): ?string
{
return $this->datosContacto;
}
public function setDatosContacto(?string $datosContacto): static
{
$this->datosContacto = $datosContacto;
return $this;
}
public function getGeolocalizacion()
{
return $this->geolocalizacion;
}
public function setGeolocalizacion(?array $geolocalizacion): static
{
$this->geolocalizacion = $geolocalizacion;
return $this;
}
public function getDeletedAt(): ?\DateTimeInterface
{
return $this->deletedAt;
}
public function setDeletedAt(?\DateTimeInterface $deletedAt): static
{
$this->deletedAt = $deletedAt;
return $this;
}
public function getUpdatedAt(): ?\DateTimeInterface
{
return $this->updatedAt;
}
public function setUpdatedAt(\DateTimeInterface $updatedAt): static
{
$this->updatedAt = $updatedAt;
return $this;
}
public function getCreatedAt(): ?\DateTimeInterface
{
return $this->createdAt;
}
public function setCreatedAt(\DateTimeInterface $createdAt): static
{
$this->createdAt = $createdAt;
return $this;
}
public function getProvincia(): ?Provincia
{
return $this->provincia;
}
public function setProvincia(?Provincia $provincia): static
{
$this->provincia = $provincia;
return $this;
}
public function getMunicipio(): ?Municipio
{
return $this->municipio;
}
public function setMunicipio(?Municipio $municipio): static
{
$this->municipio = $municipio;
return $this;
}
/**
* @return Collection<int, CentroFormacionAcogeGrupo>
*/
public function getCentroFormacionAcogeGrupos(): Collection
{
return $this->centroFormacionAcogeGrupos;
}
public function addCentroFormacionAcogeGrupo(CentroFormacionAcogeGrupo $centroFormacionAcogeGrupo): static
{
if (!$this->centroFormacionAcogeGrupos->contains($centroFormacionAcogeGrupo)) {
$this->centroFormacionAcogeGrupos->add($centroFormacionAcogeGrupo);
$centroFormacionAcogeGrupo->setCentroFormacion($this);
}
return $this;
}
public function removeCentroFormacionAcogeGrupo(CentroFormacionAcogeGrupo $centroFormacionAcogeGrupo): static
{
if ($this->centroFormacionAcogeGrupos->removeElement($centroFormacionAcogeGrupo)) {
// set the owning side to null (unless already changed)
if ($centroFormacionAcogeGrupo->getCentroFormacion() === $this) {
$centroFormacionAcogeGrupo->setCentroFormacion(null);
}
}
return $this;
}
/**
* @return Collection<int, UsuarioHermes>
*/
public function getUsuarioHermesFavorito(): Collection
{
return $this->usuarioHermesFavorito;
}
public function addUsuarioHermesFavorito(UsuarioHermes $usuarioHermesFavorito): static
{
if (!$this->usuarioHermesFavorito->contains($usuarioHermesFavorito)) {
$this->usuarioHermesFavorito->add($usuarioHermesFavorito);
}
return $this;
}
public function removeUsuarioHermesFavorito(UsuarioHermes $usuarioHermesFavorito): static
{
$this->usuarioHermesFavorito->removeElement($usuarioHermesFavorito);
return $this;
}
/**
* Obtiene el nombre del centro de formación (razón social)
*/
public function getNombre(): ?string
{
return $this->getDataFromArray('razon_social');
}
/**
* Obtiene la web del centro de formación
*/
public function getWeb(): ?string
{
return $this->getDataFromArray('web');
}
/**
* Obtiene el email del centro de formación
*/
public function getEmail(): ?string
{
return $this->getDataFromArray('email');
}
/**
* Obtiene el teléfono principal del centro de formación
*/
public function getTelefono1(): ?string
{
return $this->getDataFromArray('telefono_1');
}
/**
* Obtiene el teléfono secundario del centro de formación
*/
public function getTelefono2(): ?string
{
return $this->getDataFromArray('telefono_2');
}
/**
* Obtiene la latitud del centro de formación
*/
public function getLatitud(): ?string
{
return $this->getDataFromArray('latitud');
}
/**
* Obtiene la longitud del centro de formación
*/
public function getLongitud(): ?string
{
return $this->getDataFromArray('longitud');
}
/**
* Obtiene la dirección del centro de formación
*/
public function getDireccion(): ?string
{
return $this->getDataFromArray('direccion');
}
/**
* Obtiene el código postal del centro de formación
*/
public function getCodigoPostal(): ?string
{
return $this->getDataFromArray('codigo_postal');
}
/**
* Obtiene el NIF del centro de formación
*/
public function getNif(): ?string
{
return $this->getDataFromArray('nif');
}
}