src/Entity/Etapa.php line 12

  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\EtapaRepository;
  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: EtapaRepository::class)]
  9. class Etapa
  10. {
  11.     #[ORM\Id]
  12.     #[ORM\GeneratedValue]
  13.     #[ORM\Column]
  14.     private ?int $id = null;
  15.     #[ORM\Column(length: 255)]
  16.     private ?string $nome = null;
  17.     #[ORM\Column(type: Types::DATE_MUTABLE)]
  18.     private ?\DateTimeInterface $prazo = null;
  19.     #[ORM\ManyToOne(inversedBy: 'etapas')]
  20.     #[ORM\JoinColumn(nullable: false)]
  21.     private ?User $user = null;
  22.     #[ORM\ManyToOne(inversedBy: 'etapas')]
  23.     private ?Documento $documento = null;
  24.     #[ORM\Column(nullable: true)]
  25.     private ?\DateTimeImmutable $updatedAt = null;
  26.     #[ORM\ManyToOne(inversedBy: 'etapas')]
  27.     #[ORM\JoinColumn(nullable: false)]
  28.     private ?Fluxo $fluxo = null;
  29.     #[ORM\Column]
  30.     private ?int $ordem = null;
  31.     #[ORM\ManyToOne(inversedBy: 'etapas')]
  32.     private ?Registro $registro = null;
  33.     #[ORM\OneToMany(mappedBy: 'etapa', targetEntity: Cx::class)]
  34.     private Collection $cx;
  35.     #[ORM\OneToMany(mappedBy: 'etapa', targetEntity: Caixa::class)]
  36.     private Collection $caixa;
  37.     #[ORM\OneToMany(mappedBy: 'etapa', targetEntity: Documento::class)]
  38.     private Collection $documentos;
  39.     
  40.     #[ORM\Column(length: 255, nullable: true)]
  41.     private ?string $obs = null;
  42.     
  43.     #[ORM\ManyToOne(inversedBy: 'etapas')]
  44.     private ?Prompt $prompt = null;
  45.     public function __construct()
  46.     {
  47.         $this->cx = new ArrayCollection();
  48.         $this->caixa = new ArrayCollection();
  49.         $this->documentos = new ArrayCollection();
  50.     }
  51.     
  52.     public function getId(): ?int
  53.     {
  54.         return $this->id;
  55.     }
  56.     public function getNome(): ?string
  57.     {
  58.         return $this->nome;
  59.     }
  60.     public function setNome(string $nome): static
  61.     {
  62.         $this->nome = $nome;
  63.         return $this;
  64.     }
  65.     public function getPrazo(): ?\DateTimeInterface
  66.     {
  67.         return $this->prazo;
  68.     }
  69.     public function setPrazo(\DateTimeInterface $prazo): static
  70.     {
  71.         $this->prazo = $prazo;
  72.         return $this;
  73.     }
  74.     public function getUser(): ?User
  75.     {
  76.         return $this->user;
  77.     }
  78.     public function setUser(?User $user): static
  79.     {
  80.         $this->user = $user;
  81.         return $this;
  82.     }
  83.     public function getDocumento(): ?Documento
  84.     {
  85.         return $this->documento;
  86.     }
  87.     public function setDocumento(?Documento $documento): static
  88.     {
  89.         $this->documento = $documento;
  90.         return $this;
  91.     }
  92.     public function getUpdatedAt(): ?\DateTimeImmutable
  93.     {
  94.         return $this->updatedAt;
  95.     }
  96.     public function setUpdatedAt(?\DateTimeImmutable $updatedAt): static
  97.     {
  98.         $this->updatedAt = $updatedAt;
  99.         return $this;
  100.     }
  101.     public function getFluxo(): ?Fluxo
  102.     {
  103.         return $this->fluxo;
  104.     }
  105.     public function setFluxo(?Fluxo $fluxo): static
  106.     {
  107.         $this->fluxo = $fluxo;
  108.         return $this;
  109.     }
  110.     public function getOrdem(): ?int
  111.     {
  112.         return $this->ordem;
  113.     }
  114.     public function setOrdem(int $ordem): static
  115.     {
  116.         $this->ordem = $ordem;
  117.         return $this;
  118.     }
  119.     public function getRegistro(): ?Registro
  120.     {
  121.         return $this->registro;
  122.     }
  123.     public function setRegistro(?Registro $registro): static
  124.     {
  125.         $this->registro = $registro;
  126.         return $this;
  127.     }
  128.     /**
  129.      * @return Collection<int, Cx>
  130.      */
  131.     public function getCx(): Collection
  132.     {
  133.         return $this->cx;
  134.     }
  135.     public function addCx(Cx $cx): static
  136.     {
  137.         if (!$this->cx->contains($cx)) {
  138.             $this->cx->add($cx);
  139.             $cx->setEtapa($this);
  140.         }
  141.         return $this;
  142.     }
  143.     public function removeCx(Cx $cx): static
  144.     {
  145.         if ($this->cx->removeElement($cx)) {
  146.             // set the owning side to null (unless already changed)
  147.             if ($cx->getEtapa() === $this) {
  148.                 $cx->setEtapa(null);
  149.             }
  150.         }
  151.         return $this;
  152.     }
  153.     /**
  154.      * @return Collection<int, Caixa>
  155.      */
  156.     public function getCaixa(): Collection
  157.     {
  158.         return $this->caixa;
  159.     }
  160.     public function addCaixa(Caixa $caixa): static
  161.     {
  162.         if (!$this->caixa->contains($caixa)) {
  163.             $this->caixa->add($caixa);
  164.             $caixa->setEtapa($this);
  165.         }
  166.         return $this;
  167.     }
  168.     public function removeCaixa(Caixa $caixa): static
  169.     {
  170.         if ($this->caixa->removeElement($caixa)) {
  171.             // set the owning side to null (unless already changed)
  172.             if ($caixa->getEtapa() === $this) {
  173.                 $caixa->setEtapa(null);
  174.             }
  175.         }
  176.         return $this;
  177.     }
  178.     /**
  179.      * @return Collection<int, Documento>
  180.      */
  181.     public function getDocumentos(): Collection
  182.     {
  183.         return $this->documentos;
  184.     }
  185.     public function addDocumento(Documento $documento): static
  186.     {
  187.         if (!$this->documentos->contains($documento)) {
  188.             $this->documentos->add($documento);
  189.             $documento->setEtapa($this);
  190.         }
  191.         return $this;
  192.     }
  193.     public function removeDocumento(Documento $documento): static
  194.     {
  195.         if ($this->documentos->removeElement($documento)) {
  196.             // set the owning side to null (unless already changed)
  197.             if ($documento->getEtapa() === $this) {
  198.                 $documento->setEtapa(null);
  199.             }
  200.         }
  201.         return $this;
  202.     }
  203.     public function getObs(): ?string
  204.     {
  205.         return $this->obs;
  206.     }
  207.     public function setObs(?string $obs): static
  208.     {
  209.         $this->obs = $obs;
  210.         return $this;
  211.     }
  212.     
  213.     public function getPrompt(): ?Prompt
  214.     {
  215.         return $this->prompt;
  216.     }
  217.     public function setPrompt(?Prompt $prompt): static
  218.     {
  219.         $this->prompt = $prompt;
  220.         return $this;
  221.     }
  222. }