src/Entity/Firmante.php line 20

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