<?php
namespace App\Core\Entity\Subscripciones;
use App\Core\Entity\Curso;
use App\Core\Entity\Estudiante;
use App\Core\Entity\Maestro;
use App\Core\Repository\Subscripciones\PagoSubscripcionRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=PagoSubscripcionRepository::class)
*/
class PagoSubscripcion
{
const JSON_FIELDS = ['id', 'curso' => ['id'], 'maestro' => ['id'], 'estudiante' => ['id'], 'fechaPago', 'fechaExpiracion', 'monto', 'tipo', 'detalles', 'estado'];
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\ManyToOne(targetEntity=Curso::class, inversedBy="pagosSubscripcion")
*/
private $curso;
/**
* @ORM\ManyToOne(targetEntity=Maestro::class, inversedBy="pagosSubscripcion")
*/
private $maestro;
/**
* @ORM\ManyToOne(targetEntity=Estudiante::class, inversedBy="pagosSubscripcion")
*/
private $estudiante;
/**
* @ORM\Column(type="datetime")
*/
private $fechaPago;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $fechaExpiracion;
/**
* @ORM\Column(type="float", nullable=true)
*/
private $monto;
/**
* @ORM\Column(type="string", length=50)
* cupoAlumnosCurso
* cursosMaestro
* cursosEstudiante
*/
private $tipo;
/**
* @ORM\Column(type="json", nullable=true)
*/
private $detalles = [];
/**
* @ORM\Column(type="integer")
* 1 = activa
* 2 = vencida, pendiente de pago, 3 dias de gracia
* 3 = vencida, inhabilitada
* 4 = invalida
*/
private $estado;
/**
* @ORM\OneToMany(targetEntity=HistorialPagoSubscripcion::class, mappedBy="suscripcion")
*/
private $historialPagosSubscripcion;
public function __construct()
{
$this->historialPagosSubscripcion = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getCurso(): ?Curso
{
return $this->curso;
}
public function setCurso(?Curso $curso): self
{
$this->curso = $curso;
return $this;
}
public function getMaestro(): ?Maestro
{
return $this->maestro;
}
public function setMaestro(?Maestro $maestro): self
{
$this->maestro = $maestro;
return $this;
}
public function getEstudiante(): ?Estudiante
{
return $this->estudiante;
}
public function setEstudiante(?Estudiante $estudiante): self
{
$this->estudiante = $estudiante;
return $this;
}
public function getFechaPago(): ?\DateTimeInterface
{
return $this->fechaPago;
}
public function setFechaPago(\DateTimeInterface $fechaPago): self
{
$this->fechaPago = $fechaPago;
return $this;
}
public function getFechaExpiracion(): ?\DateTimeInterface
{
return $this->fechaExpiracion;
}
public function setFechaExpiracion(?\DateTimeInterface $fechaExpiracion): self
{
$this->fechaExpiracion = $fechaExpiracion;
return $this;
}
public function getMonto(): ?float
{
return $this->monto;
}
public function setMonto(?float $monto): self
{
$this->monto = $monto;
return $this;
}
public function getTipo(): ?string
{
return $this->tipo;
}
public function setTipo(string $tipo): self
{
$this->tipo = $tipo;
return $this;
}
public function getDetalles(): ?array
{
return $this->detalles;
}
public function setDetalles(?array $detalles): self
{
$this->detalles = $detalles;
return $this;
}
public function getEstado(): ?int
{
return $this->estado;
}
public function setEstado(?int $estado): self
{
$this->estado = $estado;
return $this;
}
/**
* @return Collection|HistorialPagoSubscripcion[]
*/
public function getHistorialPagosSubscripcion(): Collection
{
return $this->historialPagosSubscripcion;
}
public function getNombreSuscripcion() {
}
}