src/Entity/Fluxo.php line 11

  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\FluxoRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassFluxoRepository::class)]
  8. class Fluxo
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column]
  13.     private ?int $id null;
  14.     #[ORM\Column(length255)]
  15.     private ?string $nome null;
  16.     #[ORM\Column]
  17.     private ?\DateTimeImmutable $createdAt null;
  18.     #[ORM\ManyToOne(inversedBy'fluxos')]
  19.     #[ORM\JoinColumn(nullablefalse)]
  20.     private ?User $user null;
  21.     #[ORM\OneToMany(mappedBy'fluxo'targetEntityEtapa::class)]
  22.     private Collection $etapas;
  23.     #[ORM\ManyToOne(inversedBy'fluxos')]
  24.     private ?Cliente $cliente null;
  25.     #[ORM\Column(length255nullabletrue)]
  26.     private ?string $obs null;
  27.     #[ORM\OneToMany(mappedBy'fluxo'targetEntityCaixa::class,)]
  28.     private Collection $caixas;
  29.     public function __construct()
  30.     {
  31.         $this->etapas = new ArrayCollection();
  32.         $this->createdAt = new \DateTimeImmutable('America/Sao_Paulo');
  33.         $this->caixas = new ArrayCollection();
  34.  
  35.     }
  36.     public function getId(): ?int
  37.     {
  38.         return $this->id;
  39.     }
  40.     public function getNome(): ?string
  41.     {
  42.         return $this->nome;
  43.     }
  44.     public function setNome(string $nome): static
  45.     {
  46.         $this->nome $nome;
  47.         return $this;
  48.     }
  49.     public function getCreatedAt(): ?\DateTimeImmutable
  50.     {
  51.         return $this->createdAt;
  52.     }
  53.     public function setCreatedAt(\DateTimeImmutable $createdAt): static
  54.     {
  55.         $this->createdAt $createdAt;
  56.         return $this;
  57.     }
  58.     public function getUser(): ?User
  59.     {
  60.         return $this->user;
  61.     }
  62.     public function setUser(?User $user): static
  63.     {
  64.         $this->user $user;
  65.         return $this;
  66.     }
  67.     /**
  68.      * @return Collection<int, Etapa>
  69.      */
  70.     public function getEtapas(): Collection
  71.     {
  72.         return $this->etapas;
  73.     }
  74.     public function addEtapa(Etapa $etapa): static
  75.     {
  76.         if (!$this->etapas->contains($etapa)) {
  77.             $this->etapas->add($etapa);
  78.             $etapa->setFluxo($this);
  79.         }
  80.         return $this;
  81.     }
  82.     public function removeEtapa(Etapa $etapa): static
  83.     {
  84.         if ($this->etapas->removeElement($etapa)) {
  85.             // set the owning side to null (unless already changed)
  86.             if ($etapa->getFluxo() === $this) {
  87.                 $etapa->setFluxo(null);
  88.             }
  89.         }
  90.         return $this;
  91.     }
  92.     public function getCliente(): ?Cliente
  93.     {
  94.         return $this->cliente;
  95.     }
  96.     public function setCliente(?Cliente $cliente): static
  97.     {
  98.         $this->cliente $cliente;
  99.         return $this;
  100.     }
  101.     public function getObs(): ?string
  102.     {
  103.         return $this->obs;
  104.     }
  105.     public function setObs(?string $obs): static
  106.     {
  107.         $this->obs $obs;
  108.         return $this;
  109.     }
  110.     /**
  111.      * @return Collection<int, Caixa>
  112.      */
  113.     public function getCaixas(): Collection
  114.     {
  115.         return $this->caixas;
  116.     }
  117.     public function addCaixa(Caixa $caixa): static
  118.     {
  119.         if (!$this->caixas->contains($caixa)) {
  120.             $this->caixas->add($caixa);
  121.             $caixa->setFluxo($this);
  122.         }
  123.         return $this;
  124.     }
  125.     public function removeCaixa(Caixa $caixa): static
  126.     {
  127.         if ($this->caixas->removeElement($caixa)) {
  128.             // set the owning side to null (unless already changed)
  129.             if ($caixa->getFluxo() === $this) {
  130.                 $caixa->setFluxo(null);
  131.             }
  132.         }
  133.         return $this;
  134.     }
  135. }