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", schema="perseo")
  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.     public function __construct()
  76.     {
  77.         $this->operaciones = new ArrayCollection();
  78.     }
  79.     public function __toString(): string
  80.     {
  81.         return $this->getNombre()??'---';
  82.     }
  83.     public function getId(): ?string
  84.     {
  85.         return $this->id;
  86.     }
  87.     public function getNombre(): ?string
  88.     {
  89.         return $this->nombre;
  90.     }
  91.     public function setNombre(?string $nombre): self
  92.     {
  93.         $this->nombre $nombre;
  94.         return $this;
  95.     }
  96.     public function getDni(): ?string
  97.     {
  98.         return $this->dni;
  99.     }
  100.     public function setDni(?string $dni): self
  101.     {
  102.         $this->dni $dni;
  103.         return $this;
  104.     }
  105.     public function getFirma(): ?string
  106.     {
  107.         return $this->firma;
  108.     }
  109.     public function setFirma(?string $firma): self
  110.     {
  111.         $this->firma $firma;
  112.         return $this;
  113.     }
  114.     public function getDescripcion(): ?string
  115.     {
  116.         return $this->descripcion;
  117.     }
  118.     public function setDescripcion(?string $descripcion): self
  119.     {
  120.         $this->descripcion $descripcion;
  121.         return $this;
  122.     }
  123.     public function getDeletedAt(): ?\DateTimeInterface
  124.     {
  125.         return $this->deletedAt;
  126.     }
  127.     public function setDeletedAt(?\DateTimeInterface $deletedAt): self
  128.     {
  129.         $this->deletedAt $deletedAt;
  130.         return $this;
  131.     }
  132.     public function getUpdatedAt(): ?\DateTimeInterface
  133.     {
  134.         return $this->updatedAt;
  135.     }
  136.     public function setUpdatedAt(\DateTimeInterface $updatedAt): self
  137.     {
  138.         $this->updatedAt $updatedAt;
  139.         return $this;
  140.     }
  141.     public function getCreatedAt(): ?\DateTimeInterface
  142.     {
  143.         return $this->createdAt;
  144.     }
  145.     public function setCreatedAt(\DateTimeInterface $createdAt): self
  146.     {
  147.         $this->createdAt $createdAt;
  148.         return $this;
  149.     }
  150.     /**
  151.      * @return Collection|Operacion[]
  152.      */
  153.     public function getOperaciones(): Collection
  154.     {
  155.         return $this->operaciones;
  156.     }
  157.     public function addOperacione(Operacion $operacione): self
  158.     {
  159.         if (!$this->operaciones->contains($operacione)) {
  160.             $this->operaciones[] = $operacione;
  161.             $operacione->setFirmante($this);
  162.         }
  163.         return $this;
  164.     }
  165.     public function removeOperacione(Operacion $operacione): self
  166.     {
  167.         if ($this->operaciones->removeElement($operacione)) {
  168.             // set the owning side to null (unless already changed)
  169.             if ($operacione->getFirmante() === $this) {
  170.                 $operacione->setFirmante(null);
  171.             }
  172.         }
  173.         return $this;
  174.     }
  175.     public function isActive(): ?bool
  176.     {
  177.         return $this->active;
  178.     }
  179.     public function setActive(?bool $active): static
  180.     {
  181.         $this->active $active;
  182.         return $this;
  183.     }
  184.     public function getFirmaFile(): ?File
  185.     {
  186.         return $this->firmaFile;
  187.     }
  188.     public function setFirmaFile(?File $firmaFile): self
  189.     {
  190.         $this->firmaFile $firmaFile;
  191.         if ($firmaFile) {
  192.             // if 'updatedAt' is not defined in your entity, use another property
  193.             $this->setUpdatedAt(new \DateTime('now'));
  194.         }
  195.         return $this;
  196.     }
  197.     public function getTipo(): ?string
  198.     {
  199.         return $this->tipo;
  200.     }
  201.     public function setTipo(?string $tipo): static
  202.     {
  203.         $this->tipo $tipo;
  204.         return $this;
  205.     }
  206.     public function getIdioma(): ?string
  207.     {
  208.         return $this->idioma;
  209.     }
  210.     public function setIdioma(?string $idioma): static
  211.     {
  212.         $this->idioma $idioma;
  213.         return $this;
  214.     }
  215. }