<?php
namespace App\Entity;
use DateTime;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\HttpFoundation\File\File;
use Vich\UploaderBundle\Mapping\Annotation as Vich;
/**
* @ORM\Entity
* @ORM\Table(name="entidad")
* @ORM\InheritanceType("SINGLE_TABLE")
* @ORM\DiscriminatorColumn(name="type", type="string")
* @ORM\DiscriminatorMap({
* "empresa":"App\Entity\Empresa",
* "entidad_colaboradora":"App\Entity\EntidadColaboradora",
* "entidad_representativa":"App\Entity\EntidadRepresentativa",
* "consorci":"App\Entity\Consorci"
* })
*/
#[Vich\Uploadable]
abstract class Entidad extends BaseEntity
{
/**
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
/**
* @ORM\Column(type="string", nullable=true, name="id_externo")
*/
protected $idExterno;
/**
* @ORM\Column(type="string", nullable=true)
*/
protected $foto;
/**
* @var File
*/
#[Vich\UploadableField(mapping: 'propietario', fileNameProperty: 'foto')]
protected $fotoFile;
/**
* @ORM\Column(type="string", nullable=true)
*/
protected $razonSocial;
/**
* @ORM\Column(type="string", nullable=true, name="nombre_comercial")
*/
protected $nombreComercial;
/**
* @ORM\Column(type="string", nullable=true, options={"comment":"siendo el dni, cif, nif, nie, etc ... "})
*/
protected $identificador;
/**
* @ORM\Column(type="string", nullable=true)
*/
protected $nss;
/**
* @ORM\Column(type="text", nullable=true)
*/
protected $descripcion;
/**
* @ORM\Column(type="string", nullable=true)
*/
protected $correo;
/**
* @ORM\Column(type="json", nullable=true)
*/
protected $rrss;
/**
* @ORM\Column(type="string", nullable=true)
*/
protected $web;
/**
* @ORM\Column(type="string", nullable=true, options={"comment":"Datos de la persona de contacto de la entidad"})
*/
protected $contactoNombre;
/**
* @ORM\Column(type="string", nullable=true)
*/
protected $contactoApellidos;
/**
* @ORM\Column(type="boolean", nullable=true, name="info_public")
*/
protected $infoPublic;
/**
* @ORM\Column(type="boolean", nullable=true, name="info_profile_public")
*/
protected $infoProfilePublic;
/**
* @ORM\Column(type="string", nullable=true)
*/
protected $direccion;
/**
* @ORM\Column(type="string", nullable=true)
*/
protected $numero;
/**
* @ORM\Column(type="string", nullable=true)
*/
protected $escalera;
/**
* @ORM\Column(type="string", nullable=true)
*/
protected $piso;
/**
* @ORM\Column(type="string", nullable=true)
*/
protected $planta;
/**
* @ORM\Column(type="string", nullable=true)
*/
protected $puerta;
/**
* @ORM\Column(type="string", nullable=true)
*/
protected $cp;
/**
* @ORM\Column(type="string", nullable=true)
*/
protected $poblacion;
/**
* @ORM\Column(type="string", nullable=true)
*/
protected $provincia;
/**
* @ORM\Column(type="string", nullable=true)
*/
protected $telefonos;
/**
* @ORM\Column(type="string", nullable=true)
*/
protected $pais;
/**
* @ORM\Column(type="json", nullable=true)
*/
protected $imagenes;
/**
* @ORM\Column(type="boolean", nullable=true, options={"default":1})
*/
protected $activo;
/**
* @ORM\Column(type="datetime", nullable=true, name="deleted_at")
*/
protected $deletedAt;
/**
* @ORM\Column(type="datetime", nullable=false, name="updated_at", options={"default":"2024-01-01 00:00:00"})
*/
protected $updatedAt;
/**
* @ORM\Column(type="datetime", nullable=false, name="created_at", options={"default":"2024-01-01 00:00:00"})
*/
protected $createdAt;
/**
* @ORM\OneToMany(targetEntity=\App\Entity\Recurso::class, mappedBy="entidad")
*/
private $recursos;
public function __construct()
{
$this->recursos = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getIdExterno(): ?string
{
return $this->idExterno;
}
public function setIdExterno(?string $idExterno): static
{
$this->idExterno = $idExterno;
return $this;
}
public function getRazonSocial(): ?string
{
return $this->razonSocial;
}
public function setRazonSocial(?string $razonSocial): static
{
$this->razonSocial = $razonSocial;
return $this;
}
public function getIdentificador(): ?string
{
return $this->identificador;
}
public function setIdentificador(?string $identificador): static
{
$this->identificador = $identificador;
return $this;
}
public function getCorreo(): ?string
{
return $this->correo;
}
public function setCorreo(?string $correo): static
{
$this->correo = $correo;
return $this;
}
public function getDireccion(): ?string
{
return $this->direccion;
}
public function setDireccion(?string $direccion): static
{
$this->direccion = $direccion;
return $this;
}
public function getNumero(): ?string
{
return $this->numero;
}
public function setNumero(?string $numero): static
{
$this->numero = $numero;
return $this;
}
public function getEscalera(): ?string
{
return $this->escalera;
}
public function setEscalera(?string $escalera): static
{
$this->escalera = $escalera;
return $this;
}
public function getPiso(): ?string
{
return $this->piso;
}
public function setPiso(?string $piso): static
{
$this->piso = $piso;
return $this;
}
public function getPlanta(): ?string
{
return $this->planta;
}
public function setPlanta(?string $planta): static
{
$this->planta = $planta;
return $this;
}
public function getPuerta(): ?string
{
return $this->puerta;
}
public function setPuerta(?string $puerta): static
{
$this->puerta = $puerta;
return $this;
}
public function getCp(): ?string
{
return $this->cp;
}
public function setCp(?string $cp): static
{
$this->cp = $cp;
return $this;
}
public function getPoblacion(): ?string
{
return $this->poblacion;
}
public function setPoblacion(?string $poblacion): static
{
$this->poblacion = $poblacion;
return $this;
}
public function getProvincia(): ?string
{
return $this->provincia;
}
public function setProvincia(?string $provincia): static
{
$this->provincia = $provincia;
return $this;
}
public function getTelefonos(): ?string
{
return $this->telefonos;
}
public function setTelefonos(?string $telefonos): static
{
$this->telefonos = $telefonos;
return $this;
}
public function getPais(): ?string
{
return $this->pais;
}
public function setPais(?string $pais): static
{
$this->pais = $pais;
return $this;
}
public function isActivo(): ?bool
{
return $this->activo;
}
public function setActivo(?bool $activo): static
{
$this->activo = $activo;
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 __toString(): string
{
return $this->getRazonSocial();
}
public function getNss(): ?string
{
return $this->nss;
}
public function setNss(?string $nss): static
{
$this->nss = $nss;
return $this;
}
public function getNombreComercial(): ?string
{
return $this->nombreComercial;
}
public function setNombreComercial(?string $nombreComercial): static
{
$this->nombreComercial = $nombreComercial;
return $this;
}
public function getDescripcion(): ?string
{
return $this->descripcion;
}
public function setDescripcion(?string $descripcion): static
{
$this->descripcion = $descripcion;
return $this;
}
public function getRrss(): ?array
{
return $this->rrss;
}
public function setRrss(?array $rrss): static
{
$this->rrss = $rrss;
return $this;
}
public function getWeb(): ?string
{
return $this->web;
}
public function setWeb(?string $web): static
{
$this->web = $web;
return $this;
}
public function isInfoPublic(): ?bool
{
return $this->infoPublic;
}
public function setInfoPublic(?bool $infoPublic): static
{
$this->infoPublic = $infoPublic;
return $this;
}
public function isInfoProfilePublic(): ?bool
{
return $this->infoProfilePublic;
}
public function setInfoProfilePublic(?bool $infoProfilePublic): static
{
$this->infoProfilePublic = $infoProfilePublic;
return $this;
}
public function getImagenes(): ?array
{
return $this->imagenes;
}
public function setImagenes(?array $imagenes): static
{
$this->imagenes = $imagenes;
return $this;
}
public function getFoto(): ?string
{
return $this->foto;
}
public function setFoto(?string $foto): static
{
$this->foto = $foto;
return $this;
}
public function getFotoFile(): ?File
{
return $this->fotoFile;
}
public function setFotoFile(?File $fotoFile): self
{
$this->fotoFile = $fotoFile;
if ($fotoFile) {
$this->setUpdatedAt(new DateTime('now'));
}
return $this;
}
public function getContactoNombre(): ?string
{
return $this->contactoNombre;
}
public function setContactoNombre(?string $contactoNombre): static
{
$this->contactoNombre = $contactoNombre;
return $this;
}
public function getContactoApellidos(): ?string
{
return $this->contactoApellidos;
}
public function setContactoApellidos(?string $contactoApellidos): static
{
$this->contactoApellidos = $contactoApellidos;
return $this;
}
/**
* @return Collection<int, Recurso>
*/
public function getRecursos(): Collection
{
return $this->recursos;
}
public function addRecurso(Recurso $recurso): static
{
if (!$this->recursos->contains($recurso)) {
$this->recursos->add($recurso);
$recurso->setEntidad($this);
}
return $this;
}
public function removeRecurso(Recurso $recurso): static
{
if ($this->recursos->removeElement($recurso)) {
// set the owning side to null (unless already changed)
if ($recurso->getEntidad() === $this) {
$recurso->setEntidad(null);
}
}
return $this;
}
}