<?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(repositoryClass="App\Repository\EmpresaRepository")
* @ORM\Table(name="empresa")
* @Gedmo\SoftDeleteable(fieldName="deletedAt", timeAware=false, hardDelete=true)
*/
class Empresa
{
/**
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @ORM\Column(type="string", nullable=true)
*/
private $cod;
/**
* @ORM\Column(type="string", nullable=true)
*/
private $cif;
/**
* @ORM\Column(type="string", nullable=true, name="razon_social")
*/
private $razonSocial;
/**
* @ORM\Column(type="string", nullable=true, name="nombre_comercial")
*/
private $nombreComercial;
/**
* @ORM\Column(type="string", nullable=true)
*/
private $direccion;
/**
* @ORM\Column(type="string", nullable=true)
*/
private $telefono;
/**
* @ORM\Column(type="string", nullable=true)
*/
private $email;
/**
* @ORM\Column(type="boolean", nullable=true, options={"default":1})
*/
private $active;
/**
* @ORM\Column(type="datetime", nullable=true, name="deleted_at")
*/
private $deletedAt;
/**
* @ORM\Column(type="datetime", nullable=false, name="updated_at", options={"default":"2022-01-01 00:00:00"})
* @Gedmo\Timestampable(on="update")
*/
private $updatedAt;
/**
* @ORM\Column(type="datetime", nullable=false, name="created_at", options={"default":"2022-01-01 00:00:00"})
* @Gedmo\Timestampable(on="create")
*/
private $createdAt;
/**
* @ORM\OneToMany(targetEntity=\App\Entity\PlantillaAbstract::class, mappedBy="empresa")
*/
private $plantillas;
/**
* @ORM\OneToMany(targetEntity=\App\Entity\UnidadNegocio::class, mappedBy="empresa")
*/
private $unidadNegocios;
/**
* @ORM\OneToMany(targetEntity=\App\Entity\Reloj::class, mappedBy="empresa")
*/
private $relojes;
/**
* @ORM\OneToMany(targetEntity=\App\Entity\Firmante::class, mappedBy="empresa")
*/
private $firmantes;
public function __construct()
{
$this->plantillas = new ArrayCollection();
$this->unidadNegocios = new ArrayCollection();
$this->relojes = new ArrayCollection();
$this->firmantes = new ArrayCollection();
}
public function __toString(): string
{
return $this->cod;
}
public function getId(): ?int
{
return $this->id;
}
public function getCod(): ?string
{
return $this->cod;
}
public function setCod(?string $cod): static
{
$this->cod = $cod;
return $this;
}
public function getCif(): ?string
{
return $this->cif;
}
public function setCif(?string $cif): static
{
$this->cif = $cif;
return $this;
}
public function getRazonSocial(): ?string
{
return $this->razonSocial;
}
public function setRazonSocial(?string $razonSocial): static
{
$this->razonSocial = $razonSocial;
return $this;
}
public function getDireccion(): ?string
{
return $this->direccion;
}
public function setDireccion(?string $direccion): static
{
$this->direccion = $direccion;
return $this;
}
public function getTelefono(): ?string
{
return $this->telefono;
}
public function setTelefono(?string $telefono): static
{
$this->telefono = $telefono;
return $this;
}
public function getEmail(): ?string
{
return $this->email;
}
public function setEmail(?string $email): static
{
$this->email = $email;
return $this;
}
public function isActive(): ?bool
{
return $this->active;
}
public function setActive(?bool $active): static
{
$this->active = $active;
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;
}
/**
* @return Collection<int, PlantillaAbstract>
*/
public function getPlantillas(): Collection
{
return $this->plantillas;
}
public function addPlantilla(PlantillaAbstract $plantilla): static
{
if (!$this->plantillas->contains($plantilla)) {
$this->plantillas->add($plantilla);
$plantilla->setEmpresa($this);
}
return $this;
}
public function removePlantilla(PlantillaAbstract $plantilla): static
{
if ($this->plantillas->removeElement($plantilla)) {
// set the owning side to null (unless already changed)
if ($plantilla->getEmpresa() === $this) {
$plantilla->setEmpresa(null);
}
}
return $this;
}
/**
* @return Collection<int, UnidadNegocio>
*/
public function getUnidadNegocios(): Collection
{
return $this->unidadNegocios;
}
public function addUnidadNegocio(UnidadNegocio $unidadNegocio): static
{
if (!$this->unidadNegocios->contains($unidadNegocio)) {
$this->unidadNegocios->add($unidadNegocio);
$unidadNegocio->setEmpresa($this);
}
return $this;
}
public function removeUnidadNegocio(UnidadNegocio $unidadNegocio): static
{
if ($this->unidadNegocios->removeElement($unidadNegocio)) {
// set the owning side to null (unless already changed)
if ($unidadNegocio->getEmpresa() === $this) {
$unidadNegocio->setEmpresa(null);
}
}
return $this;
}
/**
* @return Collection<int, Reloj>
*/
public function getRelojes(): Collection
{
return $this->relojes;
}
public function addReloje(Reloj $reloje): static
{
if (!$this->relojes->contains($reloje)) {
$this->relojes->add($reloje);
$reloje->setEmpresa($this);
}
return $this;
}
public function removeReloje(Reloj $reloje): static
{
if ($this->relojes->removeElement($reloje)) {
// set the owning side to null (unless already changed)
if ($reloje->getEmpresa() === $this) {
$reloje->setEmpresa(null);
}
}
return $this;
}
/**
* @return Collection<int, Firmante>
*/
public function getFirmantes(): Collection
{
return $this->firmantes;
}
public function addFirmante(Firmante $firmante): static
{
if (!$this->firmantes->contains($firmante)) {
$this->firmantes->add($firmante);
$firmante->setEmpresa($this);
}
return $this;
}
public function removeFirmante(Firmante $firmante): static
{
if ($this->firmantes->removeElement($firmante)) {
// set the owning side to null (unless already changed)
if ($firmante->getEmpresa() === $this) {
$firmante->setEmpresa(null);
}
}
return $this;
}
public function getNombreComercial(): ?string
{
return $this->nombreComercial;
}
public function setNombreComercial(?string $nombreComercial): static
{
$this->nombreComercial = $nombreComercial;
return $this;
}
}