<?php
namespace App\Entity;
use App\Repository\SeguroPrivadoRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use DateTime;
/**
* @ORM\Entity(repositoryClass=SeguroPrivadoRepository::class)
* @ORM\HasLifecycleCallbacks
*/
class SeguroPrivado
{
/**
* @ORM\Id()
* @ORM\GeneratedValue()
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=100)
*/
private $nombre;
/**
* @ORM\Column(type="boolean")
*/
private $estado;
/**
* @ORM\Column(type="datetime")
*/
private $created_at;
/**
* @ORM\Column(type="datetime")
*/
private $updated_at;
/**
* @ORM\OneToMany(targetEntity=PlanoCabecera::class, mappedBy="seguroprivado")
*/
private $planoCabeceras;
/**
* @ORM\Column(type="smallint")
*/
private $tipo;
/**
* @ORM\Column(type="integer")
*/
private $user_crea;
/**
* @ORM\Column(type="integer")
*/
private $user_modifica;
/**
* @ORM\Column(type="string", length=50)
*/
private $ip_crea;
/**
* @ORM\Column(type="string", length=50)
*/
private $ip_modifica;
/**
* @ORM\OneToMany(targetEntity=Agenda::class, mappedBy="seguro")
*/
private $agendas;
/**
* @ORM\OneToMany(targetEntity=Paciente::class, mappedBy="seguro")
*/
private $pacientes;
/**
* @ORM\OneToMany(targetEntity=LogAgenda::class, mappedBy="seguro")
*/
private $logAgendas;
/**
* @ORM\OneToMany(targetEntity=ExamenOrden::class, mappedBy="seguro")
*/
private $examenOrdens;
/**
* @ORM\OneToMany(targetEntity=HdSolicitud::class, mappedBy="seguro")
*/
private $hdSolicituds;
/**
* @ORM\Column(type="string", length=10)
*/
private $color;
public function __construct()
{
$this->planoCabeceras = new ArrayCollection();
$this->agendas = new ArrayCollection();
$this->pacientes = new ArrayCollection();
$this->logAgendas = new ArrayCollection();
$this->examenOrdens = new ArrayCollection();
$this->hdSolicituds = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getNombre(): ?string
{
return $this->nombre;
}
public function setNombre(string $nombre): self
{
$this->nombre = $nombre;
return $this;
}
public function getEstado(): ?bool
{
return $this->estado;
}
public function setEstado(bool $estado): self
{
$this->estado = $estado;
return $this;
}
public function getCreatedAt(): ?\DateTimeInterface
{
return $this->created_at;
}
public function setCreatedAt(\DateTimeInterface $created_at): self
{
$this->created_at = $created_at;
return $this;
}
public function getUpdatedAt(): ?\DateTimeInterface
{
return $this->updated_at;
}
public function setUpdatedAt(\DateTimeInterface $updated_at): self
{
$this->updated_at = $updated_at;
return $this;
}
public function __toString(){
// to show the name of the Category in the select
return $this->nombre;
// to show the id of the Category in the select
// return $this->id;
}
/**
* @ORM\PrePersist
* @ORM\PreUpdate
*/
public function updatedTimestamps(): void
{
$dateTimeNow = new DateTime('now');
$this->setUpdatedAt($dateTimeNow);
if ($this->getCreatedAt() === null) {
$this->setCreatedAt($dateTimeNow);
}
}
/**
* @return Collection|PlanoCabecera[]
*/
public function getPlanoCabeceras(): Collection
{
return $this->planoCabeceras;
}
public function addPlanoCabecera(PlanoCabecera $planoCabecera): self
{
if (!$this->planoCabeceras->contains($planoCabecera)) {
$this->planoCabeceras[] = $planoCabecera;
$planoCabecera->setSeguroprivado($this);
}
return $this;
}
public function removePlanoCabecera(PlanoCabecera $planoCabecera): self
{
if ($this->planoCabeceras->contains($planoCabecera)) {
$this->planoCabeceras->removeElement($planoCabecera);
// set the owning side to null (unless already changed)
if ($planoCabecera->getSeguroprivado() === $this) {
$planoCabecera->setSeguroprivado(null);
}
}
return $this;
}
public function getTipo(): ?int
{
return $this->tipo;
}
public function setTipo(int $tipo): self
{
$this->tipo = $tipo;
return $this;
}
public function getUserCrea(): ?int
{
return $this->user_crea;
}
public function setUserCrea(int $user_crea): self
{
$this->user_crea = $user_crea;
return $this;
}
public function getUserModifica(): ?int
{
return $this->user_modifica;
}
public function setUserModifica(int $user_modifica): self
{
$this->user_modifica = $user_modifica;
return $this;
}
public function getIpCrea(): ?string
{
return $this->ip_crea;
}
public function setIpCrea(string $ip_crea): self
{
$this->ip_crea = $ip_crea;
return $this;
}
public function getIpModifica(): ?string
{
return $this->ip_modifica;
}
public function setIpModifica(string $ip_modifica): self
{
$this->ip_modifica = $ip_modifica;
return $this;
}
/**
* @return Collection|Agenda[]
*/
public function getAgendas(): Collection
{
return $this->agendas;
}
public function addAgenda(Agenda $agenda): self
{
if (!$this->agendas->contains($agenda)) {
$this->agendas[] = $agenda;
$agenda->setSeguro($this);
}
return $this;
}
public function removeAgenda(Agenda $agenda): self
{
if ($this->agendas->removeElement($agenda)) {
// set the owning side to null (unless already changed)
if ($agenda->getSeguro() === $this) {
$agenda->setSeguro(null);
}
}
return $this;
}
/**
* @return Collection|Paciente[]
*/
public function getPacientes(): Collection
{
return $this->pacientes;
}
public function addPaciente(Paciente $paciente): self
{
if (!$this->pacientes->contains($paciente)) {
$this->pacientes[] = $paciente;
$paciente->setSeguro($this);
}
return $this;
}
public function removePaciente(Paciente $paciente): self
{
if ($this->pacientes->removeElement($paciente)) {
// set the owning side to null (unless already changed)
if ($paciente->getSeguro() === $this) {
$paciente->setSeguro(null);
}
}
return $this;
}
/**
* @return Collection|LogAgenda[]
*/
public function getLogAgendas(): Collection
{
return $this->logAgendas;
}
public function addLogAgenda(LogAgenda $logAgenda): self
{
if (!$this->logAgendas->contains($logAgenda)) {
$this->logAgendas[] = $logAgenda;
$logAgenda->setSeguro($this);
}
return $this;
}
public function removeLogAgenda(LogAgenda $logAgenda): self
{
if ($this->logAgendas->removeElement($logAgenda)) {
// set the owning side to null (unless already changed)
if ($logAgenda->getSeguro() === $this) {
$logAgenda->setSeguro(null);
}
}
return $this;
}
/**
* @return Collection|ExamenOrden[]
*/
public function getExamenOrdens(): Collection
{
return $this->examenOrdens;
}
public function addExamenOrden(ExamenOrden $examenOrden): self
{
if (!$this->examenOrdens->contains($examenOrden)) {
$this->examenOrdens[] = $examenOrden;
$examenOrden->setSeguro($this);
}
return $this;
}
public function removeExamenOrden(ExamenOrden $examenOrden): self
{
if ($this->examenOrdens->removeElement($examenOrden)) {
// set the owning side to null (unless already changed)
if ($examenOrden->getSeguro() === $this) {
$examenOrden->setSeguro(null);
}
}
return $this;
}
/**
* @return Collection|HdSolicitud[]
*/
public function getHdSolicituds(): Collection
{
return $this->hdSolicituds;
}
public function addHdSolicitud(HdSolicitud $hdSolicitud): self
{
if (!$this->hdSolicituds->contains($hdSolicitud)) {
$this->hdSolicituds[] = $hdSolicitud;
$hdSolicitud->setSeguro($this);
}
return $this;
}
public function removeHdSolicitud(HdSolicitud $hdSolicitud): self
{
if ($this->hdSolicituds->removeElement($hdSolicitud)) {
// set the owning side to null (unless already changed)
if ($hdSolicitud->getSeguro() === $this) {
$hdSolicitud->setSeguro(null);
}
}
return $this;
}
public function getColor(): ?string
{
return $this->color;
}
public function setColor(string $color): self
{
$this->color = $color;
return $this;
}
}