src/Entity/EstadoFactura.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\EstadoFacturaRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=EstadoFacturaRepository::class)
  9.  */
  10. class EstadoFactura
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\GeneratedValue
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\Column(type="string", length=255)
  20.      */
  21.     private $nombre;
  22.     /**
  23.      * @ORM\Column(type="boolean", nullable=true)
  24.      */
  25.     private $oculto;
  26.     /**
  27.      * @ORM\OneToMany(targetEntity=Factura::class, mappedBy="estado")
  28.      */
  29.     private $facturas;
  30.     /**
  31.      * @ORM\OneToMany(targetEntity=FacturaGenerica::class, mappedBy="estado")
  32.      */
  33.     private $facturasGenericas;
  34.     public function __construct()
  35.     {
  36.         $this->facturas = new ArrayCollection();
  37.         $this->facturasGenericas = new ArrayCollection();
  38.     }
  39.     public function getId(): ?int
  40.     {
  41.         return $this->id;
  42.     }
  43.     public function getNombre(): ?string
  44.     {
  45.         return $this->nombre;
  46.     }
  47.     public function setNombre(string $nombre): self
  48.     {
  49.         $this->nombre $nombre;
  50.         return $this;
  51.     }
  52.     public function isOculto(): ?bool
  53.     {
  54.         return $this->oculto;
  55.     }
  56.     public function setOculto(?bool $oculto): self
  57.     {
  58.         $this->oculto $oculto;
  59.         return $this;
  60.     }
  61.     /**
  62.      * @return Collection<int, Factura>
  63.      */
  64.     public function getFacturas(): Collection
  65.     {
  66.         return $this->facturas;
  67.     }
  68.     public function addFactura(Factura $factura): self
  69.     {
  70.         if (!$this->facturas->contains($factura)) {
  71.             $this->facturas[] = $factura;
  72.             $factura->setEstado($this);
  73.         }
  74.         return $this;
  75.     }
  76.     public function removeFactura(Factura $factura): self
  77.     {
  78.         if ($this->facturas->removeElement($factura)) {
  79.             // set the owning side to null (unless already changed)
  80.             if ($factura->getEstado() === $this) {
  81.                 $factura->setEstado(null);
  82.             }
  83.         }
  84.         return $this;
  85.     }
  86.     /**
  87.      * @return Collection<int, FacturaGenerica>
  88.      */
  89.     public function getFacturasGenericas(): Collection
  90.     {
  91.         return $this->facturasGenericas;
  92.     }
  93.     public function addFacturasGenerica(FacturaGenerica $facturasGenerica): self
  94.     {
  95.         if (!$this->facturasGenericas->contains($facturasGenerica)) {
  96.             $this->facturasGenericas[] = $facturasGenerica;
  97.             $facturasGenerica->setEstado($this);
  98.         }
  99.         return $this;
  100.     }
  101.     public function removeFacturasGenerica(FacturaGenerica $facturasGenerica): self
  102.     {
  103.         if ($this->facturasGenericas->removeElement($facturasGenerica)) {
  104.             // set the owning side to null (unless already changed)
  105.             if ($facturasGenerica->getEstado() === $this) {
  106.                 $facturasGenerica->setEstado(null);
  107.             }
  108.         }
  109.         return $this;
  110.     }
  111. }