src/Entity/Empresa.php line 16

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(repositoryClass="App\Repository\EmpresaRepository")
  10.  * @ORM\Table(name="empresa")
  11.  * @Gedmo\SoftDeleteable(fieldName="deletedAt", timeAware=false, hardDelete=true)
  12.  */
  13. class Empresa
  14. {
  15.     /**
  16.      * @ORM\Id
  17.      * @ORM\Column(type="integer")
  18.      * @ORM\GeneratedValue(strategy="AUTO")
  19.      */
  20.     private $id;
  21.     /**
  22.      * @ORM\Column(type="string", nullable=true)
  23.      */
  24.     private $cod;
  25.     /**
  26.      * @ORM\Column(type="string", nullable=true)
  27.      */
  28.     private $cif;
  29.     /**
  30.      * @ORM\Column(type="string", nullable=true, name="razon_social")
  31.      */
  32.     private $razonSocial;
  33.     /**
  34.      * @ORM\Column(type="string", nullable=true, name="nombre_comercial")
  35.      */
  36.     private $nombreComercial;
  37.     /**
  38.      * @ORM\Column(type="string", nullable=true)
  39.      */
  40.     private $direccion;
  41.     /**
  42.      * @ORM\Column(type="string", nullable=true)
  43.      */
  44.     private $telefono;
  45.     /**
  46.      * @ORM\Column(type="string", nullable=true)
  47.      */
  48.     private $email;
  49.     /**
  50.      * @ORM\Column(type="boolean", nullable=true, options={"default":1})
  51.      */
  52.     private $active;
  53.     /**
  54.      * @ORM\Column(type="integer", nullable=true, name="numero_factura")
  55.      */
  56.     private $numeroFactura;
  57.     /**
  58.      * @ORM\Column(type="datetime", nullable=true, name="deleted_at")
  59.      */
  60.     private $deletedAt;
  61.     /**
  62.      * @ORM\Column(type="datetime", nullable=false, name="updated_at", options={"default":"2022-01-01 00:00:00"})
  63.      * @Gedmo\Timestampable(on="update")
  64.      */
  65.     private $updatedAt;
  66.     /**
  67.      * @ORM\Column(type="datetime", nullable=false, name="created_at", options={"default":"2022-01-01 00:00:00"})
  68.      * @Gedmo\Timestampable(on="create")
  69.      */
  70.     private $createdAt;
  71.     /**
  72.      * @ORM\OneToMany(targetEntity=\App\Entity\PlantillaAbstract::class, mappedBy="empresa")
  73.      */
  74.     private $plantillas;
  75.     /**
  76.      * @ORM\OneToMany(targetEntity=\App\Entity\UnidadNegocio::class, mappedBy="empresa")
  77.      */
  78.     private $unidadNegocios;
  79.     /**
  80.      * @ORM\OneToMany(targetEntity=\App\Entity\Reloj::class, mappedBy="empresa")
  81.      */
  82.     private $relojes;
  83.     /**
  84.      * @ORM\OneToMany(targetEntity=\App\Entity\Firmante::class, mappedBy="empresa")
  85.      */
  86.     private $firmantes;
  87.     public function __construct()
  88.     {
  89.         $this->plantillas = new ArrayCollection();
  90.         $this->unidadNegocios = new ArrayCollection();
  91.         $this->relojes = new ArrayCollection();
  92.         $this->firmantes = new ArrayCollection();
  93.     }
  94.     public function __toString(): string
  95.     {
  96.         return $this->cod;
  97.     }
  98.     public function getId(): ?int
  99.     {
  100.         return $this->id;
  101.     }
  102.     public function getCod(): ?string
  103.     {
  104.         return $this->cod;
  105.     }
  106.     public function setCod(?string $cod): static
  107.     {
  108.         $this->cod $cod;
  109.         return $this;
  110.     }
  111.     public function getCif(): ?string
  112.     {
  113.         return $this->cif;
  114.     }
  115.     public function setCif(?string $cif): static
  116.     {
  117.         $this->cif $cif;
  118.         return $this;
  119.     }
  120.     public function getRazonSocial(): ?string
  121.     {
  122.         return $this->razonSocial;
  123.     }
  124.     public function setRazonSocial(?string $razonSocial): static
  125.     {
  126.         $this->razonSocial $razonSocial;
  127.         return $this;
  128.     }
  129.     public function getDireccion(): ?string
  130.     {
  131.         return $this->direccion;
  132.     }
  133.     public function setDireccion(?string $direccion): static
  134.     {
  135.         $this->direccion $direccion;
  136.         return $this;
  137.     }
  138.     public function getTelefono(): ?string
  139.     {
  140.         return $this->telefono;
  141.     }
  142.     public function setTelefono(?string $telefono): static
  143.     {
  144.         $this->telefono $telefono;
  145.         return $this;
  146.     }
  147.     public function getEmail(): ?string
  148.     {
  149.         return $this->email;
  150.     }
  151.     public function setEmail(?string $email): static
  152.     {
  153.         $this->email $email;
  154.         return $this;
  155.     }
  156.     public function isActive(): ?bool
  157.     {
  158.         return $this->active;
  159.     }
  160.     public function setActive(?bool $active): static
  161.     {
  162.         $this->active $active;
  163.         return $this;
  164.     }
  165.     public function getDeletedAt(): ?\DateTimeInterface
  166.     {
  167.         return $this->deletedAt;
  168.     }
  169.     public function setDeletedAt(?\DateTimeInterface $deletedAt): static
  170.     {
  171.         $this->deletedAt $deletedAt;
  172.         return $this;
  173.     }
  174.     public function getUpdatedAt(): ?\DateTimeInterface
  175.     {
  176.         return $this->updatedAt;
  177.     }
  178.     public function setUpdatedAt(\DateTimeInterface $updatedAt): static
  179.     {
  180.         $this->updatedAt $updatedAt;
  181.         return $this;
  182.     }
  183.     public function getCreatedAt(): ?\DateTimeInterface
  184.     {
  185.         return $this->createdAt;
  186.     }
  187.     public function setCreatedAt(\DateTimeInterface $createdAt): static
  188.     {
  189.         $this->createdAt $createdAt;
  190.         return $this;
  191.     }
  192.     /**
  193.      * @return Collection<int, PlantillaAbstract>
  194.      */
  195.     public function getPlantillas(): Collection
  196.     {
  197.         return $this->plantillas;
  198.     }
  199.     public function addPlantilla(PlantillaAbstract $plantilla): static
  200.     {
  201.         if (!$this->plantillas->contains($plantilla)) {
  202.             $this->plantillas->add($plantilla);
  203.             $plantilla->setEmpresa($this);
  204.         }
  205.         return $this;
  206.     }
  207.     public function removePlantilla(PlantillaAbstract $plantilla): static
  208.     {
  209.         if ($this->plantillas->removeElement($plantilla)) {
  210.             // set the owning side to null (unless already changed)
  211.             if ($plantilla->getEmpresa() === $this) {
  212.                 $plantilla->setEmpresa(null);
  213.             }
  214.         }
  215.         return $this;
  216.     }
  217.     /**
  218.      * @return Collection<int, UnidadNegocio>
  219.      */
  220.     public function getUnidadNegocios(): Collection
  221.     {
  222.         return $this->unidadNegocios;
  223.     }
  224.     public function addUnidadNegocio(UnidadNegocio $unidadNegocio): static
  225.     {
  226.         if (!$this->unidadNegocios->contains($unidadNegocio)) {
  227.             $this->unidadNegocios->add($unidadNegocio);
  228.             $unidadNegocio->setEmpresa($this);
  229.         }
  230.         return $this;
  231.     }
  232.     public function removeUnidadNegocio(UnidadNegocio $unidadNegocio): static
  233.     {
  234.         if ($this->unidadNegocios->removeElement($unidadNegocio)) {
  235.             // set the owning side to null (unless already changed)
  236.             if ($unidadNegocio->getEmpresa() === $this) {
  237.                 $unidadNegocio->setEmpresa(null);
  238.             }
  239.         }
  240.         return $this;
  241.     }
  242.     /**
  243.      * @return Collection<int, Reloj>
  244.      */
  245.     public function getRelojes(): Collection
  246.     {
  247.         return $this->relojes;
  248.     }
  249.     public function addReloje(Reloj $reloje): static
  250.     {
  251.         if (!$this->relojes->contains($reloje)) {
  252.             $this->relojes->add($reloje);
  253.             $reloje->setEmpresa($this);
  254.         }
  255.         return $this;
  256.     }
  257.     public function removeReloje(Reloj $reloje): static
  258.     {
  259.         if ($this->relojes->removeElement($reloje)) {
  260.             // set the owning side to null (unless already changed)
  261.             if ($reloje->getEmpresa() === $this) {
  262.                 $reloje->setEmpresa(null);
  263.             }
  264.         }
  265.         return $this;
  266.     }
  267.     /**
  268.      * @return Collection<int, Firmante>
  269.      */
  270.     public function getFirmantes(): Collection
  271.     {
  272.         return $this->firmantes;
  273.     }
  274.     public function addFirmante(Firmante $firmante): static
  275.     {
  276.         if (!$this->firmantes->contains($firmante)) {
  277.             $this->firmantes->add($firmante);
  278.             $firmante->setEmpresa($this);
  279.         }
  280.         return $this;
  281.     }
  282.     public function removeFirmante(Firmante $firmante): static
  283.     {
  284.         if ($this->firmantes->removeElement($firmante)) {
  285.             // set the owning side to null (unless already changed)
  286.             if ($firmante->getEmpresa() === $this) {
  287.                 $firmante->setEmpresa(null);
  288.             }
  289.         }
  290.         return $this;
  291.     }
  292.     public function getNombreComercial(): ?string
  293.     {
  294.         return $this->nombreComercial;
  295.     }
  296.     public function setNombreComercial(?string $nombreComercial): static
  297.     {
  298.         $this->nombreComercial $nombreComercial;
  299.         return $this;
  300.     }
  301.     public function getNumeroFactura(): ?int
  302.     {
  303.         return $this->numeroFactura;
  304.     }
  305.     public function setNumeroFactura(?int $numeroFactura): static
  306.     {
  307.         $this->numeroFactura $numeroFactura;
  308.         return $this;
  309.     }
  310. }