src/Domain/Entity/DocumentacionRegistro.php line 16

Open in your IDE?
  1. <?php
  2. namespace App\Domain\Entity;
  3. use DateTime;
  4. use DateTimeInterface;
  5. use App\Domain\Validator as CRLAssert;
  6. use Doctrine\DBAL\Types\Types;
  7. use Symfony\Component\Validator\Constraints as Assert;
  8. use Vich\UploaderBundle\Mapping\Annotation as Vich;
  9. /**
  10.  * @CRLAssert\ContraintsValidarExpedienteRegistro
  11.  */
  12. #[Vich\Uploadable]
  13. class DocumentacionRegistro extends Documentacion
  14. {
  15.     private ?string $fileSealing null;
  16.     /**
  17.      * @Assert\File(
  18.      *     maxSize = "20M",
  19.      *     mimeTypes = {"application/pdf"},
  20.      *     mimeTypesMessage = "file_format {{ type }} {{ types }}",
  21.      *     uploadErrorMessage = "file_upload {{ limit }}"
  22.      * )
  23.      */
  24.     #[Vich\UploadableField(mapping'upload'fileNameProperty'fileSealing')]
  25.     protected $fileSealingFile;
  26.     private ?string $tipo null;
  27.     private ?string $numeroRegistro null;
  28.     private ?DateTimeInterface $fechaRegistro null;
  29.     private ?DateTimeInterface $horaRegistro null;
  30.     private ?Sede $sede null;
  31.     private ?Expediente $expediente null;
  32.     private ?string $observaciones null;
  33.     private ?CustomRegistro $custom null;
  34.     private ?Expediente $expedienteSolicitud null;
  35.     private ?SonataUserUser $creador null;
  36.     public function __construct()
  37.     {
  38.         $this->custom = new CustomRegistro();
  39.     }
  40.     public function getTipo(): ?string
  41.     {
  42.         return $this->tipo;
  43.     }
  44.     public function setTipo(?string $tipo): static
  45.     {
  46.         $this->tipo $tipo;
  47.         return $this;
  48.     }
  49.     public function getNumeroRegistro(): ?string
  50.     {
  51.         return $this->numeroRegistro;
  52.     }
  53.     public function setNumeroRegistro(?string $numeroRegistro): static
  54.     {
  55.         $this->numeroRegistro $numeroRegistro;
  56.         return $this;
  57.     }
  58.     public function getFechaRegistro(): ?DateTimeInterface
  59.     {
  60.         return $this->fechaRegistro;
  61.     }
  62.     public function setFechaRegistro(?DateTimeInterface $fechaRegistro): static
  63.     {
  64.         $this->fechaRegistro $fechaRegistro;
  65.         return $this;
  66.     }
  67.     public function getHoraRegistro(): ?DateTimeInterface
  68.     {
  69.         return $this->horaRegistro;
  70.     }
  71.     public function setHoraRegistro(?DateTimeInterface $horaRegistro): static
  72.     {
  73.         $this->horaRegistro $horaRegistro;
  74.         return $this;
  75.     }
  76.     public function getFechaHoraRegistro():?DateTimeInterface
  77.     {
  78.         $fecha DateTime::createFromFormat('d/m/Y H:i:s'$this->getFechaRegistro()?->format('d/m/Y') . ' ' $this->getHoraRegistro()?->format('H:i:s'));
  79.         return $fecha $fecha null;
  80.     }
  81.     public function getFechaHoraRegistroStr():?string
  82.     {
  83.         return $this->getFechaHoraRegistro()?->format('d/m/Y H:i:s');
  84.     }
  85.     public function getObservaciones(): ?string
  86.     {
  87.         return $this->observaciones;
  88.     }
  89.     public function setObservaciones(?string $observaciones): static
  90.     {
  91.         $this->observaciones $observaciones;
  92.         return $this;
  93.     }
  94.     public function getExpediente(): ?Expediente
  95.     {
  96.         return $this->expediente;
  97.     }
  98.     public function setExpediente(?Expediente $expediente): static
  99.     {
  100.         $this->expediente $expediente;
  101.         return $this;
  102.     }
  103.     public function getSede(): ?Sede
  104.     {
  105.         return $this->sede;
  106.     }
  107.     public function setSede(?Sede $sede): static
  108.     {
  109.         $this->sede $sede;
  110.         return $this;
  111.     }
  112.     public function getCustom(): ?CustomRegistro
  113.     {
  114.         return $this->custom;
  115.     }
  116.     public function setCustom(?CustomRegistro $customRegistro): static
  117.     {
  118.         $this->custom $customRegistro;
  119.         return $this;
  120.     }
  121.     public function getExpedienteSolicitud(): ?Expediente
  122.     {
  123.         return $this->expedienteSolicitud;
  124.     }
  125.     public function setExpedienteSolicitud(?Expediente $expedienteSolicitud): static
  126.     {
  127.         // unset the owning side of the relation if necessary
  128.         if ($expedienteSolicitud === null && $this->expedienteSolicitud !== null) {
  129.             $this->expedienteSolicitud->setSolicitud(null);
  130.         }
  131.         // set the owning side of the relation if necessary
  132.         if ($expedienteSolicitud !== null && $expedienteSolicitud->getSolicitud() !== $this) {
  133.             $expedienteSolicitud->setSolicitud($this);
  134.         }
  135.         $this->expedienteSolicitud $expedienteSolicitud;
  136.         return $this;
  137.     }
  138.     public function getFileSealing(): ?string
  139.     {
  140.         return $this->fileSealing;
  141.     }
  142.     public function setFileSealing(?string $fileSealing): static
  143.     {
  144.         $this->fileSealing $fileSealing;
  145.         return $this;
  146.     }
  147.     /**
  148.      * @return mixed
  149.      */
  150.     public function getFileSealingFile()
  151.     {
  152.         return $this->fileSealingFile;
  153.     }
  154.     /**
  155.      * @param mixed $fileSealingFile
  156.      * @return Documentacion
  157.      */
  158.     public function setFileSealingFile($fileSealingFile)
  159.     {
  160.         $this->fileSealingFile $fileSealingFile;
  161.         if (null !== $fileSealingFile$this->updatedAt = new DateTime();
  162.         return $this;
  163.     }
  164.     public function getCreador(): ?SonataUserUser
  165.     {
  166.         return $this->creador;
  167.     }
  168.     public function setCreador(?SonataUserUser $creador): static
  169.     {
  170.         $this->creador $creador;
  171.         return $this;
  172.     }
  173.     public function getCreatedAtStr(): ?string
  174.     {
  175.         return parent::getCreatedAt()->format('d/m/Y H:i:s');
  176.     }
  177. }//class