<?php
namespace App\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
use Symfony\Component\HttpFoundation\File\File;
use Vich\UploaderBundle\Mapping\Annotation as Vich;
/**
* @ORM\Entity(repositoryClass="App\Repository\FirmanteRepository")
* @ORM\Table(name="firmante", schema="perseo")
* @Gedmo\SoftDeleteable(fieldName="deletedAt", timeAware=false, hardDelete=true)
* @Vich\Uploadable
*/
class Firmante
{
/**
* @ORM\Id
* @ORM\Column(type="bigint", options={"unsigned":true})
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @ORM\Column(type="string", nullable=true)
*/
private $tipo;
/**
* @ORM\Column(type="string", length=2, nullable=true)
*/
private $idioma;
/**
* @ORM\Column(type="string", nullable=true)
*/
private $nombre;
/**
* @ORM\Column(type="string", nullable=true)
*/
private $dni;
/**
* @ORM\Column(type="string", nullable=true)
*/
private $firma;
/**
* @Vich\UploadableField(mapping="firmante", fileNameProperty="firma")
* @var File
*/
private $firmaFile;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $descripcion;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $active;
/**
* @ORM\Column(type="datetime", nullable=true, name="deleted_at")
*/
private $deletedAt;
/**
* @ORM\Column(type="datetime", nullable=false, name="updated_at", options={"default":"2022-01-01 00:00:00"})
* @Gedmo\Timestampable(on="update")
*/
private $updatedAt;
/**
* @ORM\Column(type="datetime", nullable=false, name="created_at", options={"default":"2022-01-01 00:00:00"})
* @Gedmo\Timestampable(on="create")
*/
private $createdAt;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Operacion", mappedBy="firmante")
*/
private $operaciones;
public function __construct()
{
$this->operaciones = new ArrayCollection();
}
public function __toString(): string
{
return $this->getNombre()??'---';
}
public function getId(): ?string
{
return $this->id;
}
public function getNombre(): ?string
{
return $this->nombre;
}
public function setNombre(?string $nombre): self
{
$this->nombre = $nombre;
return $this;
}
public function getDni(): ?string
{
return $this->dni;
}
public function setDni(?string $dni): self
{
$this->dni = $dni;
return $this;
}
public function getFirma(): ?string
{
return $this->firma;
}
public function setFirma(?string $firma): self
{
$this->firma = $firma;
return $this;
}
public function getDescripcion(): ?string
{
return $this->descripcion;
}
public function setDescripcion(?string $descripcion): self
{
$this->descripcion = $descripcion;
return $this;
}
public function getDeletedAt(): ?\DateTimeInterface
{
return $this->deletedAt;
}
public function setDeletedAt(?\DateTimeInterface $deletedAt): self
{
$this->deletedAt = $deletedAt;
return $this;
}
public function getUpdatedAt(): ?\DateTimeInterface
{
return $this->updatedAt;
}
public function setUpdatedAt(\DateTimeInterface $updatedAt): self
{
$this->updatedAt = $updatedAt;
return $this;
}
public function getCreatedAt(): ?\DateTimeInterface
{
return $this->createdAt;
}
public function setCreatedAt(\DateTimeInterface $createdAt): self
{
$this->createdAt = $createdAt;
return $this;
}
/**
* @return Collection|Operacion[]
*/
public function getOperaciones(): Collection
{
return $this->operaciones;
}
public function addOperacione(Operacion $operacione): self
{
if (!$this->operaciones->contains($operacione)) {
$this->operaciones[] = $operacione;
$operacione->setFirmante($this);
}
return $this;
}
public function removeOperacione(Operacion $operacione): self
{
if ($this->operaciones->removeElement($operacione)) {
// set the owning side to null (unless already changed)
if ($operacione->getFirmante() === $this) {
$operacione->setFirmante(null);
}
}
return $this;
}
public function isActive(): ?bool
{
return $this->active;
}
public function setActive(?bool $active): static
{
$this->active = $active;
return $this;
}
public function getFirmaFile(): ?File
{
return $this->firmaFile;
}
public function setFirmaFile(?File $firmaFile): self
{
$this->firmaFile = $firmaFile;
if ($firmaFile) {
// if 'updatedAt' is not defined in your entity, use another property
$this->setUpdatedAt(new \DateTime('now'));
}
return $this;
}
public function getTipo(): ?string
{
return $this->tipo;
}
public function setTipo(?string $tipo): static
{
$this->tipo = $tipo;
return $this;
}
public function getIdioma(): ?string
{
return $this->idioma;
}
public function setIdioma(?string $idioma): static
{
$this->idioma = $idioma;
return $this;
}
}