src/Entity/Cliente.php line 11

  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ClienteRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassClienteRepository::class)]
  8. class Cliente
  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(length255nullabletrue)]
  17.     private ?string $extraFields null;
  18.     #[ORM\ManyToMany(targetEntityUser::class, inversedBy'clientes')]
  19.     private Collection $users;
  20.     #[ORM\ManyToMany(targetEntityCaixa::class, mappedBy'clientes')]
  21.     private Collection $caixas;
  22.     #[ORM\OneToMany(mappedBy'cliente'targetEntityClassificacao::class)]
  23.     private Collection $classificacaos;
  24.     #[ORM\OneToMany(mappedBy'cliente'targetEntityDocumento::class)]
  25.     private Collection $documentos;
  26.     #[ORM\OneToMany(mappedBy'cliente'targetEntityTipo::class)]
  27.     private Collection $tipos;
  28.     #[ORM\ManyToOne(inversedBy'clientes')]
  29.     private ?ClienteAll $clienteAll null;
  30.     #[ORM\OneToMany(mappedBy'cliente'targetEntityFluxo::class)]
  31.     private Collection $fluxos;
  32.     public function __construct()
  33.     {
  34.         $this->users = new ArrayCollection();
  35.         $this->caixas = new ArrayCollection();
  36.         $this->classificacaos = new ArrayCollection();
  37.         $this->registros = new ArrayCollection();
  38.         $this->documentos = new ArrayCollection();
  39.         $this->tipos = new ArrayCollection();
  40.         $this->fluxos = new ArrayCollection();
  41.     }
  42.     public function getId(): ?int
  43.     {
  44.         return $this->id;
  45.     }
  46.     public function getNome(): ?string
  47.     {
  48.         return $this->nome;
  49.     }
  50.     public function setNome(string $nome): static
  51.     {
  52.         $this->nome $nome;
  53.         return $this;
  54.     }
  55.     public function getExtraFields(): ?string
  56.     {
  57.         return $this->extraFields;
  58.     }
  59.     public function setExtraFields(?string $extraFields): static
  60.     {
  61.         $this->extraFields $extraFields;
  62.         return $this;
  63.     }
  64.     /**
  65.      * @return Collection<int, User>
  66.      */
  67.     public function getUsers(): Collection
  68.     {
  69.         return $this->users;
  70.     }
  71.     public function addUser(User $user): static
  72.     {
  73.         if (!$this->users->contains($user)) {
  74.             $this->users->add($user);
  75.         }
  76.         return $this;
  77.     }
  78.     public function removeUser(User $user): static
  79.     {
  80.         $this->users->removeElement($user);
  81.         return $this;
  82.     }
  83.     /**
  84.      * @return Collection<int, Caixa>
  85.      */
  86.     public function getCaixas(): Collection
  87.     {
  88.         return $this->caixas;
  89.     }
  90.     public function addCaixa(Caixa $caixa): static
  91.     {
  92.         if (!$this->caixas->contains($caixa)) {
  93.             $this->caixas->add($caixa);
  94.             $caixa->addCliente($this);
  95.         }
  96.         return $this;
  97.     }
  98.     public function removeCaixa(Caixa $caixa): static
  99.     {
  100.         if ($this->caixas->removeElement($caixa)) {
  101.             $caixa->removeCliente($this);
  102.         }
  103.         return $this;
  104.     }
  105.     /**
  106.      * @return Collection<int, Classificacao>
  107.      */
  108.     public function getClassificacaos(): Collection
  109.     {
  110.         return $this->classificacaos;
  111.     }
  112.     public function addClassificacao(Classificacao $classificacao): static
  113.     {
  114.         if (!$this->classificacaos->contains($classificacao)) {
  115.             $this->classificacaos->add($classificacao);
  116.             $classificacao->setCliente($this);
  117.         }
  118.         return $this;
  119.     }
  120.     public function removeClassificacao(Classificacao $classificacao): static
  121.     {
  122.         if ($this->classificacaos->removeElement($classificacao)) {
  123.             // set the owning side to null (unless already changed)
  124.             if ($classificacao->getCliente() === $this) {
  125.                 $classificacao->setCliente(null);
  126.             }
  127.         }
  128.         return $this;
  129.     }
  130.   
  131.     /**
  132.      * @return Collection<int, Documento>
  133.      */
  134.     public function getDocumentos(): Collection
  135.     {
  136.         return $this->documentos;
  137.     }
  138.     public function addDocumento(Documento $documento): static
  139.     {
  140.         if (!$this->documentos->contains($documento)) {
  141.             $this->documentos->add($documento);
  142.             $documento->setCliente($this);
  143.         }
  144.         return $this;
  145.     }
  146.     public function removeDocumento(Documento $documento): static
  147.     {
  148.         if ($this->documentos->removeElement($documento)) {
  149.             // set the owning side to null (unless already changed)
  150.             if ($documento->getCliente() === $this) {
  151.                 $documento->setCliente(null);
  152.             }
  153.         }
  154.         return $this;
  155.     }
  156.     /**
  157.      * @return Collection<int, Tipo>
  158.      */
  159.     public function getTipos(): Collection
  160.     {
  161.         return $this->tipos;
  162.     }
  163.     public function addTipo(Tipo $tipo): static
  164.     {
  165.         if (!$this->tipos->contains($tipo)) {
  166.             $this->tipos->add($tipo);
  167.             $tipo->setCliente($this);
  168.         }
  169.         return $this;
  170.     }
  171.     public function removeTipo(Tipo $tipo): static
  172.     {
  173.         if ($this->tipos->removeElement($tipo)) {
  174.             // set the owning side to null (unless already changed)
  175.             if ($tipo->getCliente() === $this) {
  176.                 $tipo->setCliente(null);
  177.             }
  178.         }
  179.         return $this;
  180.     }
  181.     /**
  182.      * @return Collection<int, Fluxo>
  183.      */
  184.     public function getFluxos(): Collection
  185.     {
  186.         return $this->fluxos;
  187.     }
  188.     public function addFluxo(Fluxo $fluxo): static
  189.     {
  190.         if (!$this->fluxos->contains($fluxo)) {
  191.             $this->fluxos->add($fluxo);
  192.             $fluxo->setCliente($this);
  193.         }
  194.         return $this;
  195.     }
  196.     public function removeFluxo(Fluxo $fluxo): static
  197.     {
  198.         if ($this->fluxos->removeElement($fluxo)) {
  199.             // set the owning side to null (unless already changed)
  200.             if ($fluxo->getCliente() === $this) {
  201.                 $fluxo->setCliente(null);
  202.             }
  203.         }
  204.         return $this;
  205.     }
  206.     public function getClienteAll(): ?ClienteAll
  207.     {
  208.         return $this->clienteAll;
  209.     }
  210.     public function setClienteAll(?ClienteAll $clienteAll): static
  211.     {
  212.         $this->clienteAll $clienteAll;
  213.         return $this;
  214.     }
  215. }