src/Entity/Firmante.php line 19

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. use Symfony\Component\HttpFoundation\File\File;
  9. use Vich\UploaderBundle\Mapping\Annotation as Vich;
  10. /**
  11.  * @ORM\Entity(repositoryClass="App\Repository\FirmanteRepository")
  12.  * @ORM\Table(name="firmante")
  13.  * @Gedmo\SoftDeleteable(fieldName="deletedAt", timeAware=false, hardDelete=true)
  14.  * @Vich\Uploadable
  15.  */
  16. class Firmante
  17. {
  18.     /**
  19.      * @ORM\Id
  20.      * @ORM\Column(type="bigint", options={"unsigned":true})
  21.      * @ORM\GeneratedValue(strategy="AUTO")
  22.      */
  23.     private $id;
  24.     /**
  25.      * @ORM\Column(type="string", nullable=true)
  26.      */
  27.     private $tipo;
  28.     /**
  29.      * @ORM\Column(type="string", length=2, nullable=true)
  30.      */
  31.     private $idioma;
  32.     /**
  33.      * @ORM\Column(type="string", nullable=true)
  34.      */
  35.     private $nombre;
  36.     /**
  37.      * @ORM\Column(type="string", nullable=true)
  38.      */
  39.     private $dni;
  40.     /**
  41.      * @ORM\Column(type="string", nullable=true)
  42.      */
  43.     private $firma;
  44.     /**
  45.      * @Vich\UploadableField(mapping="firmante", fileNameProperty="firma")
  46.      * @var File
  47.      */
  48.     private $firmaFile;
  49.     /**
  50.      * @ORM\Column(type="text", nullable=true)
  51.      */
  52.     private $descripcion;
  53.     /**
  54.      * @ORM\Column(type="boolean", nullable=true)
  55.      */
  56.     private $active;
  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\Operacion", mappedBy="firmante")
  73.      */
  74.     private $operaciones;
  75.     /**
  76.      * @ORM\ManyToOne(targetEntity=\App\Entity\Empresa::class, inversedBy="firmantes")
  77.      * @ORM\JoinColumn(name="empresa_id", referencedColumnName="id", nullable=false)
  78.      */
  79.     private $empresa;
  80.     public function __construct()
  81.     {
  82.         $this->operaciones = new ArrayCollection();
  83.     }
  84.     public function __toString(): string
  85.     {
  86.         return $this->getNombre()??'---';
  87.     }
  88.     public function getId(): ?string
  89.     {
  90.         return $this->id;
  91.     }
  92.     public function getNombre(): ?string
  93.     {
  94.         return $this->nombre;
  95.     }
  96.     public function setNombre(?string $nombre): self
  97.     {
  98.         $this->nombre $nombre;
  99.         return $this;
  100.     }
  101.     public function getDni(): ?string
  102.     {
  103.         return $this->dni;
  104.     }
  105.     public function setDni(?string $dni): self
  106.     {
  107.         $this->dni $dni;
  108.         return $this;
  109.     }
  110.     public function getFirma(): ?string
  111.     {
  112.         return $this->firma;
  113.     }
  114.     public function setFirma(?string $firma): self
  115.     {
  116.         $this->firma $firma;
  117.         return $this;
  118.     }
  119.     public function getDescripcion(): ?string
  120.     {
  121.         return $this->descripcion;
  122.     }
  123.     public function setDescripcion(?string $descripcion): self
  124.     {
  125.         $this->descripcion $descripcion;
  126.         return $this;
  127.     }
  128.     public function getDeletedAt(): ?\DateTimeInterface
  129.     {
  130.         return $this->deletedAt;
  131.     }
  132.     public function setDeletedAt(?\DateTimeInterface $deletedAt): self
  133.     {
  134.         $this->deletedAt $deletedAt;
  135.         return $this;
  136.     }
  137.     public function getUpdatedAt(): ?\DateTimeInterface
  138.     {
  139.         return $this->updatedAt;
  140.     }
  141.     public function setUpdatedAt(\DateTimeInterface $updatedAt): self
  142.     {
  143.         $this->updatedAt $updatedAt;
  144.         return $this;
  145.     }
  146.     public function getCreatedAt(): ?\DateTimeInterface
  147.     {
  148.         return $this->createdAt;
  149.     }
  150.     public function setCreatedAt(\DateTimeInterface $createdAt): self
  151.     {
  152.         $this->createdAt $createdAt;
  153.         return $this;
  154.     }
  155.     /**
  156.      * @return Collection|Operacion[]
  157.      */
  158.     public function getOperaciones(): Collection
  159.     {
  160.         return $this->operaciones;
  161.     }
  162.     public function addOperacione(Operacion $operacione): self
  163.     {
  164.         if (!$this->operaciones->contains($operacione)) {
  165.             $this->operaciones[] = $operacione;
  166.             $operacione->setFirmante($this);
  167.         }
  168.         return $this;
  169.     }
  170.     public function removeOperacione(Operacion $operacione): self
  171.     {
  172.         if ($this->operaciones->removeElement($operacione)) {
  173.             // set the owning side to null (unless already changed)
  174.             if ($operacione->getFirmante() === $this) {
  175.                 $operacione->setFirmante(null);
  176.             }
  177.         }
  178.         return $this;
  179.     }
  180.     public function isActive(): ?bool
  181.     {
  182.         return $this->active;
  183.     }
  184.     public function setActive(?bool $active): static
  185.     {
  186.         $this->active $active;
  187.         return $this;
  188.     }
  189.     public function getFirmaFile(): ?File
  190.     {
  191.         return $this->firmaFile;
  192.     }
  193.     public function setFirmaFile(?File $firmaFile): self
  194.     {
  195.         $this->firmaFile $firmaFile;
  196.         if ($firmaFile) {
  197.             // if 'updatedAt' is not defined in your entity, use another property
  198.             $this->setUpdatedAt(new \DateTime('now'));
  199.         }
  200.         return $this;
  201.     }
  202.     public function getTipo(): ?string
  203.     {
  204.         return $this->tipo;
  205.     }
  206.     public function setTipo(?string $tipo): static
  207.     {
  208.         $this->tipo $tipo;
  209.         return $this;
  210.     }
  211.     public function getIdioma(): ?string
  212.     {
  213.         return $this->idioma;
  214.     }
  215.     public function setIdioma(?string $idioma): static
  216.     {
  217.         $this->idioma $idioma;
  218.         return $this;
  219.     }
  220.     public function getEmpresa(): ?Empresa
  221.     {
  222.         return $this->empresa;
  223.     }
  224.     public function setEmpresa(?Empresa $empresa): static
  225.     {
  226.         $this->empresa $empresa;
  227.         return $this;
  228.     }
  229. }