src/Entity/Tipo.php line 11

  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\TipoRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassTipoRepository::class)]
  8. class Tipo
  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\ManyToOne(inversedBy'tipos')]
  19.     private ?Cliente $cliente null;
  20.     #[ORM\OneToMany(mappedBy'tipo'targetEntityDocumento::class)]
  21.     private Collection $documentos;
  22.     public function __construct()
  23.     {
  24.         $this->documentos = new ArrayCollection();
  25.     }
  26.     public function getId(): ?int
  27.     {
  28.         return $this->id;
  29.     }
  30.     public function getNome(): ?string
  31.     {
  32.         return $this->nome;
  33.     }
  34.     public function setNome(string $nome): static
  35.     {
  36.         $this->nome $nome;
  37.         return $this;
  38.     }
  39.     public function getExtraFields(): ?string
  40.     {
  41.         return $this->extraFields;
  42.     }
  43.     public function setExtraFields(?string $extraFields): static
  44.     {
  45.         $this->extraFields $extraFields;
  46.         return $this;
  47.     }
  48.     public function getCliente(): ?Cliente
  49.     {
  50.         return $this->cliente;
  51.     }
  52.     public function setCliente(?Cliente $cliente): static
  53.     {
  54.         $this->cliente $cliente;
  55.         return $this;
  56.     }
  57.     /**
  58.      * @return Collection<int, Documento>
  59.      */
  60.     public function getDocumentos(): Collection
  61.     {
  62.         return $this->documentos;
  63.     }
  64.     public function addDocumento(Documento $documento): static
  65.     {
  66.         if (!$this->documentos->contains($documento)) {
  67.             $this->documentos->add($documento);
  68.             $documento->setTipo($this);
  69.         }
  70.         return $this;
  71.     }
  72.     public function removeDocumento(Documento $documento): static
  73.     {
  74.         if ($this->documentos->removeElement($documento)) {
  75.             // set the owning side to null (unless already changed)
  76.             if ($documento->getTipo() === $this) {
  77.                 $documento->setTipo(null);
  78.             }
  79.         }
  80.         return $this;
  81.     }
  82. }