src/Entity/Registro.php line 12

  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\RegistroRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\DBAL\Types\Types;
  7. use Doctrine\ORM\Mapping as ORM;
  8. #[ORM\Entity(repositoryClass: RegistroRepository::class)]
  9. class Registro
  10. {
  11.     #[ORM\Id]
  12.     #[ORM\GeneratedValue]
  13.     #[ORM\Column]
  14.     private ?int $id = null;
  15.     #[ORM\Column(length: 255)]
  16.     private ?string $operacao = null;
  17.     #[ORM\Column(length: 255)]
  18.     private  ?string $user = null;
  19.     #[ORM\Column(length: 255)]
  20.     private  ?string $cliente = null;
  21.     #[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]
  22.     private ?\DateTimeInterface $data = null;
  23.     #[ORM\ManyToOne(inversedBy: 'registros')]
  24.     private ?Documento $documento = null;
  25.     #[ORM\OneToMany(mappedBy: 'registro', targetEntity: Etapa::class)]
  26.     private Collection $etapas;
  27.     #[ORM\Column(length: 255, nullable: true)]
  28.     private ?string $ip = null;
  29.     
  30.     #[ORM\ManyToOne(inversedBy: 'registros')]
  31.     private ?User $id_user = null;
  32.     
  33.     #[ORM\ManyToOne(inversedBy: 'registros')]
  34.     private ?Fluxo $fluxo = null;
  35.     public function __construct()
  36.     {
  37.         $this->data = new \DateTimeImmutable('America/Sao_Paulo');
  38.         $this->etapas = new ArrayCollection();
  39.       
  40.     }
  41.     public function getId(): ?int
  42.     {
  43.         return $this->id;
  44.     }
  45.     public function getOperacao(): ?string
  46.     {
  47.         return $this->operacao;
  48.     }
  49.     public function setOperacao(string $operacao): static
  50.     {
  51.         $this->operacao = $operacao;
  52.         return $this;
  53.     }
  54.     public function getUser(): string
  55.     {
  56.         return $this->user;
  57.     }
  58.     public function setUser(string $user): static
  59.     {
  60.         $this->user = $user;
  61.         return $this;
  62.     }
  63.     public function getCliente(): string
  64.     {
  65.         return $this->cliente;
  66.     }
  67.     public function setCliente(string $cliente): static
  68.     {
  69.         $this->cliente = $cliente;
  70.         return $this;
  71.     }
  72.     public function getData(): ?\DateTimeInterface
  73.     {
  74.         return $this->data;
  75.     }
  76.     public function setData(?\DateTimeInterface $data): static
  77.     {
  78.         $this->data = $data;
  79.         return $this;
  80.     }
  81.     public function getDocumento(): ?Documento
  82.     {
  83.         return $this->documento;
  84.     }
  85.     public function setDocumento(?Documento $documento): static
  86.     {
  87.         $this->documento = $documento;
  88.         return $this;
  89.     }
  90.     /**
  91.      * @return Collection<int, Etapa>
  92.      */
  93.     public function getEtapas(): Collection
  94.     {
  95.         return $this->etapas;
  96.     }
  97.     public function addEtapa(Etapa $etapa): static
  98.     {
  99.         if (!$this->etapas->contains($etapa)) {
  100.             $this->etapas->add($etapa);
  101.             $etapa->setRegistro($this);
  102.         }
  103.         return $this;
  104.     }
  105.     public function removeEtapa(Etapa $etapa): static
  106.     {
  107.         if ($this->etapas->removeElement($etapa)) {
  108.             // set the owning side to null (unless already changed)
  109.             if ($etapa->getRegistro() === $this) {
  110.                 $etapa->setRegistro(null);
  111.             }
  112.         }
  113.         return $this;
  114.     }
  115.     public function getIp(): ?string
  116.     {
  117.         return $this->ip;
  118.     }
  119.     public function setIp(?string $ip): static
  120.     {
  121.         $this->ip = $ip;
  122.         return $this;
  123.     }
  124.         public function getIdUser(): ?User
  125.     {
  126.         return $this->id_user;
  127.     }
  128.     public function setIdUser(?User $id_user): static
  129.     {
  130.         $this->id_user = $id_user;
  131.         return $this;
  132.     }
  133.         public function getFluxo(): ?Fluxo
  134.     {
  135.         return $this->fluxo;
  136.     }
  137.     public function setFluxo(?Fluxo $fluxo): static
  138.     {
  139.         $this->fluxo = $fluxo;
  140.         return $this;
  141.     }
  142. }