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