<?php
namespace App\Entity;
use App\Repository\FraccionamientoRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=FraccionamientoRepository::class)
*/
class Fraccionamiento
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\ManyToMany(targetEntity=Factura::class, inversedBy="fraccionamientos")
*/
private $facturas;
/**
* @ORM\ManyToMany(targetEntity=FacturaGenerica::class, inversedBy="fraccionamientos")
*/
private $facturasGenericas;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $plazos;
/**
* @ORM\Column(type="decimal", precision=10, scale=2, nullable=true)
*/
private $importeTotal;
/**
* @ORM\OneToMany(targetEntity=Concepto::class, mappedBy="fraccionamiento")
*/
private $otrosConceptos;
/**
* @ORM\ManyToOne(targetEntity=Cliente::class, inversedBy="fraccionamientos")
*/
private $cliente;
/**
* @ORM\OneToMany(targetEntity=PagoFraccionamiento::class, mappedBy="fraccionamiento", orphanRemoval=true)
*/
private $pagos;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $fechaCreacion;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $estado;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $fechaPago;
/**
* @ORM\Column(type="dateinterval", nullable=true)
*/
private $periodo;
public function __construct()
{
$this->facturas = new ArrayCollection();
$this->facturasGenericas = new ArrayCollection();
$this->otrosConceptos = new ArrayCollection();
$this->pagos = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
/**
* @return Collection<int, Factura>
*/
public function getFacturas(): Collection
{
return $this->facturas;
}
public function addFactura(Factura $factura): self
{
if (!$this->facturas->contains($factura)) {
$this->facturas[] = $factura;
}
return $this;
}
public function removeFactura(Factura $factura): self
{
$this->facturas->removeElement($factura);
return $this;
}
/**
* @return Collection<int, FacturaGenerica>
*/
public function getFacturasGenericas(): Collection
{
return $this->facturasGenericas;
}
public function addFacturasGenerica(FacturaGenerica $facturasGenerica): self
{
if (!$this->facturasGenericas->contains($facturasGenerica)) {
$this->facturasGenericas[] = $facturasGenerica;
}
return $this;
}
public function removeFacturasGenerica(FacturaGenerica $facturasGenerica): self
{
$this->facturasGenericas->removeElement($facturasGenerica);
return $this;
}
public function getPlazos(): ?int
{
return $this->plazos;
}
public function setPlazos(?int $plazos): self
{
$this->plazos = $plazos;
return $this;
}
public function getImporteTotal(): ?string
{
return $this->importeTotal;
}
public function setImporteTotal(?string $importeTotal): self
{
$this->importeTotal = $importeTotal;
return $this;
}
/**
* @return Collection<int, Concepto>
*/
public function getOtrosConceptos(): Collection
{
return $this->otrosConceptos;
}
public function addOtrosConcepto(Concepto $otrosConcepto): self
{
if (!$this->otrosConceptos->contains($otrosConcepto)) {
$this->otrosConceptos[] = $otrosConcepto;
$otrosConcepto->setFraccionamiento($this);
}
return $this;
}
public function removeOtrosConcepto(Concepto $otrosConcepto): self
{
if ($this->otrosConceptos->removeElement($otrosConcepto)) {
// set the owning side to null (unless already changed)
if ($otrosConcepto->getFraccionamiento() === $this) {
$otrosConcepto->setFraccionamiento(null);
}
}
return $this;
}
public function getCliente(): ?Cliente
{
return $this->cliente;
}
public function setCliente(?Cliente $cliente): self
{
$this->cliente = $cliente;
return $this;
}
/**
* @return Collection<int, PagoFraccionamiento>
*/
public function getPagos(): Collection
{
return $this->pagos;
}
public function addPago(PagoFraccionamiento $pago): self
{
if (!$this->pagos->contains($pago)) {
$this->pagos[] = $pago;
$pago->setFraccionamiento($this);
}
return $this;
}
public function removePago(PagoFraccionamiento $pago): self
{
if ($this->pagos->removeElement($pago)) {
// set the owning side to null (unless already changed)
if ($pago->getFraccionamiento() === $this) {
$pago->setFraccionamiento(null);
}
}
return $this;
}
public function getFechaCreacion(): ?\DateTimeInterface
{
return $this->fechaCreacion;
}
public function setFechaCreacion(?\DateTimeInterface $fechaCreacion): self
{
$this->fechaCreacion = $fechaCreacion;
return $this;
}
public function getEstado(): ?string
{
return $this->estado;
}
public function setEstado(?string $estado): self
{
$this->estado = $estado;
return $this;
}
public function getFechaPago(): ?\DateTimeInterface
{
return $this->fechaPago;
}
public function setFechaPago(?\DateTimeInterface $fechaPago): self
{
$this->fechaPago = $fechaPago;
return $this;
}
public function getPeriodo(): ?\DateInterval
{
return $this->periodo;
}
public function setPeriodo(?\DateInterval $periodo): self
{
$this->periodo = $periodo;
return $this;
}
}