src/Entity/RegistroPolicial.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\DBAL\Types\Types;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Gedmo\Mapping\Annotation as Gedmo;
  6. /**
  7.  * @ORM\Entity(repositoryClass="App\Repository\RegistroPolicialRepository")
  8.  * @ORM\EntityListeners({"App\EntityListener\RegistroPolicial\CalcularIDPerseoListener", "App\EntityListener\RegistroPolicial\CalcularIDRegistroListener"})
  9.  * @ORM\Table(name="registro_policial", schema="perseo")
  10.  * @Gedmo\SoftDeleteable(fieldName="deletedAt", timeAware=false, hardDelete=true)
  11.  */
  12. class RegistroPolicial
  13. {
  14.     /**
  15.      * @ORM\Id
  16.      * @ORM\Column(type="bigint", options={"unsigned":true})
  17.      * @ORM\GeneratedValue(strategy="AUTO")
  18.      */
  19.     protected $id;
  20.     /**
  21.      * @ORM\Column(
  22.      *     type="string",
  23.      *     unique=true,
  24.      *     nullable=false,
  25.      *     name="id_perseo",
  26.      *     options={"comment":"Identificador de perseo"}
  27.      * )
  28.      */
  29.     protected $IDperseo;
  30.     /**
  31.      * @ORM\Column(
  32.      *     type="string",
  33.      *     unique=true,
  34.      *     nullable=true,
  35.      *     name="id_registro_policial",
  36.      *     options={"comment":"Su estructura será AA/001 para compras y AA/001-G para gestión, donde se reiniciará cada año."}
  37.      * )
  38.      */
  39.     private $IDregistroPolicial;
  40.     /**
  41.      * @ORM\Column(type="datetime", nullable=true, name="fecha_comunicacion")
  42.      */
  43.     private $fechaComunicacion;
  44.     /**
  45.      * @ORM\Column(type="datetime", nullable=true, name="deleted_at")
  46.      */
  47.     protected $deletedAt;
  48.     /**
  49.      * @ORM\Column(type="datetime", nullable=false, name="updated_at", options={"default":"2022-01-01 00:00:00"})
  50.      * @Gedmo\Timestampable(on="update")
  51.      */
  52.     protected $updatedAt;
  53.     /**
  54.      * @ORM\Column(type="datetime", nullable=false, name="created_at", options={"default":"2022-01-01 00:00:00"})
  55.      * @Gedmo\Timestampable(on="create")
  56.      */
  57.     protected $createdAt;
  58.     /**
  59.      * @ORM\OneToOne(targetEntity=\App\Entity\Reloj::class, inversedBy="registroPolicial")
  60.      * @ORM\JoinColumn(name="reloj_id", referencedColumnName="id", nullable=false, unique=true)
  61.      */
  62.     protected $reloj;
  63.     public function getId(): ?string
  64.     {
  65.         return $this->id;
  66.     }
  67.     public function getIDperseo(): ?string
  68.     {
  69.         return $this->IDperseo;
  70.     }
  71.     public function setIDperseo(string $IDperseo): self
  72.     {
  73.         $this->IDperseo $IDperseo;
  74.         return $this;
  75.     }
  76.     public function getDeletedAt(): ?\DateTimeInterface
  77.     {
  78.         return $this->deletedAt;
  79.     }
  80.     public function setDeletedAt(?\DateTimeInterface $deletedAt): self
  81.     {
  82.         $this->deletedAt $deletedAt;
  83.         return $this;
  84.     }
  85.     public function getUpdatedAt(): ?\DateTimeInterface
  86.     {
  87.         return $this->updatedAt;
  88.     }
  89.     public function setUpdatedAt(\DateTimeInterface $updatedAt): self
  90.     {
  91.         $this->updatedAt $updatedAt;
  92.         return $this;
  93.     }
  94.     public function getCreatedAt(): ?\DateTimeInterface
  95.     {
  96.         return $this->createdAt;
  97.     }
  98.     public function setCreatedAt(\DateTimeInterface $createdAt): self
  99.     {
  100.         $this->createdAt $createdAt;
  101.         return $this;
  102.     }
  103.     public function getReloj(): ?Reloj
  104.     {
  105.         return $this->reloj;
  106.     }
  107.     public function setReloj(?Reloj $reloj): self
  108.     {
  109.         $this->reloj $reloj;
  110.         return $this;
  111.     }
  112.     public function getIDregistroPolicial(): ?string
  113.     {
  114.         return $this->IDregistroPolicial;
  115.     }
  116.     public function setIDregistroPolicial(string $IDregistroPolicial): static
  117.     {
  118.         $this->IDregistroPolicial $IDregistroPolicial;
  119.         return $this;
  120.     }
  121.     public function getFechaComunicacion(): ?\DateTimeInterface
  122.     {
  123.         return $this->fechaComunicacion;
  124.     }
  125.     public function setFechaComunicacion(?\DateTimeInterface $fechaComunicacion): static
  126.     {
  127.         $this->fechaComunicacion $fechaComunicacion;
  128.         return $this;
  129.     }
  130.     public function getTipo(): string
  131.     {
  132.         return '---';
  133.     }
  134.     public function getExportFechaComunicacion(): ?string
  135.     {
  136.         return $this->getFechaComunicacion()?->format('d/m/Y');
  137.     }
  138. }