<?php
namespace App\Entity;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
/**
* @ORM\Entity(repositoryClass="App\Repository\RegistroPolicialRepository")
* @ORM\EntityListeners({"App\EntityListener\RegistroPolicial\CalcularIDPerseoListener", "App\EntityListener\RegistroPolicial\CalcularIDRegistroListener"})
* @ORM\Table(name="registro_policial", schema="perseo")
* @Gedmo\SoftDeleteable(fieldName="deletedAt", timeAware=false, hardDelete=true)
*/
class RegistroPolicial
{
/**
* @ORM\Id
* @ORM\Column(type="bigint", options={"unsigned":true})
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
/**
* @ORM\Column(
* type="string",
* unique=true,
* nullable=false,
* name="id_perseo",
* options={"comment":"Identificador de perseo"}
* )
*/
protected $IDperseo;
/**
* @ORM\Column(
* type="string",
* unique=true,
* nullable=true,
* name="id_registro_policial",
* options={"comment":"Su estructura será AA/001 para compras y AA/001-G para gestión, donde se reiniciará cada año."}
* )
*/
private $IDregistroPolicial;
/**
* @ORM\Column(type="datetime", nullable=true, name="fecha_comunicacion")
*/
private $fechaComunicacion;
/**
* @ORM\Column(type="datetime", nullable=true, name="deleted_at")
*/
protected $deletedAt;
/**
* @ORM\Column(type="datetime", nullable=false, name="updated_at", options={"default":"2022-01-01 00:00:00"})
* @Gedmo\Timestampable(on="update")
*/
protected $updatedAt;
/**
* @ORM\Column(type="datetime", nullable=false, name="created_at", options={"default":"2022-01-01 00:00:00"})
* @Gedmo\Timestampable(on="create")
*/
protected $createdAt;
/**
* @ORM\OneToOne(targetEntity=\App\Entity\Reloj::class, inversedBy="registroPolicial")
* @ORM\JoinColumn(name="reloj_id", referencedColumnName="id", nullable=false, unique=true)
*/
protected $reloj;
public function getId(): ?string
{
return $this->id;
}
public function getIDperseo(): ?string
{
return $this->IDperseo;
}
public function setIDperseo(string $IDperseo): self
{
$this->IDperseo = $IDperseo;
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;
}
public function getReloj(): ?Reloj
{
return $this->reloj;
}
public function setReloj(?Reloj $reloj): self
{
$this->reloj = $reloj;
return $this;
}
public function getIDregistroPolicial(): ?string
{
return $this->IDregistroPolicial;
}
public function setIDregistroPolicial(string $IDregistroPolicial): static
{
$this->IDregistroPolicial = $IDregistroPolicial;
return $this;
}
public function getFechaComunicacion(): ?\DateTimeInterface
{
return $this->fechaComunicacion;
}
public function setFechaComunicacion(?\DateTimeInterface $fechaComunicacion): static
{
$this->fechaComunicacion = $fechaComunicacion;
return $this;
}
public function getTipo(): string
{
return '---';
}
public function getExportFechaComunicacion(): ?string
{
return $this->getFechaComunicacion()?->format('d/m/Y');
}
}