<?php
namespace App\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity
* @ORM\Table(
* name="solicitud_accion_formativa",
* indexes={
* @ORM\Index(name="idx_saf_curso", columns={"curso_id"}),
* @ORM\Index(name="idx_saf_modalidad", columns={"modalidad_id"}),
* @ORM\Index(name="idx_saf_expediente", columns={"expediente_id"}),
* @ORM\Index(name="idx_saf_deleted_at", columns={"deleted_at"}),
* @ORM\Index(name="idx_saf_updated_at", columns={"updated_at"})
* }
* )
*/
class SolicitudAccionFormativa extends \App\Entity\BaseEntity
{
/**
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @ORM\Column(type="datetime", nullable=true, name="deleted_at")
*/
private $deletedAt;
/**
* @ORM\Column(type="datetime", nullable=false, name="updated_at", options={"default":"2024-01-01 00:00:00"})
*/
private $updatedAt;
/**
* @ORM\Column(type="datetime", nullable=false, name="created_at", options={"default":"2024-01-01 00:00:00"})
*/
private $createdAt;
/**
* @ORM\Column(type="string", nullable=true, name="id_externo")
*/
private $idExterno;
/**
* @ORM\OneToMany(targetEntity=\App\Entity\Grupo::class, mappedBy="solicitudAccionFormativa")
*/
private $grupos;
/**
* @ORM\ManyToOne(targetEntity=\App\Entity\Curso::class, inversedBy="solicitudAccionFormativas")
* @ORM\JoinColumn(name="curso_id", referencedColumnName="id")
*/
private $curso;
/**
* @ORM\ManyToOne(targetEntity=\App\Entity\Expediente::class, inversedBy="solicitudAccionFormativas")
* @ORM\JoinColumn(name="expediente_id", referencedColumnName="id")
*/
private $expediente;
/**
* @ORM\ManyToOne(targetEntity=\App\Entity\Modalidad::class, inversedBy="solicitudAccionFormativas")
* @ORM\JoinColumn(name="modalidad_id", referencedColumnName="id")
*/
private $modalidad;
/**
* @ORM\ManyToMany(targetEntity=\App\Entity\UsuarioHermes::class, mappedBy="solicitudesInteres")
*/
private $usuarioHermesInteres;
/**
* @ORM\ManyToMany(targetEntity=\App\Entity\UsuarioHermes::class, mappedBy="solicitudesFavorito")
*/
private $usuarioHermesFavorito;
public function __construct()
{
$this->grupos = new ArrayCollection();
$this->usuarioHermesFavorito = new ArrayCollection();
$this->usuarioHermesInteres = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function setId($id)
{
$this->id = $id;
return $this;
}
public function getDeletedAt(): ?\DateTimeInterface
{
return $this->deletedAt;
}
public function setDeletedAt(?\DateTimeInterface $deletedAt): static
{
$this->deletedAt = $deletedAt;
return $this;
}
public function getUpdatedAt(): ?\DateTimeInterface
{
return $this->updatedAt;
}
public function setUpdatedAt(\DateTimeInterface $updatedAt): static
{
$this->updatedAt = $updatedAt;
return $this;
}
public function getCreatedAt(): ?\DateTimeInterface
{
return $this->createdAt;
}
public function setCreatedAt(\DateTimeInterface $createdAt): static
{
$this->createdAt = $createdAt;
return $this;
}
public function getIdExterno(): ?string
{
return $this->idExterno;
}
public function setIdExterno(?string $idExterno): static
{
$this->idExterno = $idExterno;
return $this;
}
/**
* @return Collection<int, Grupo>
*/
public function getGrupos(): Collection
{
return $this->grupos;
}
public function addGrupo(Grupo $grupo): static
{
if (!$this->grupos->contains($grupo)) {
$this->grupos->add($grupo);
$grupo->setSolicitudAccionFormativa($this);
}
return $this;
}
public function removeGrupo(Grupo $grupo): static
{
if ($this->grupos->removeElement($grupo)) {
// set the owning side to null (unless already changed)
if ($grupo->getSolicitudAccionFormativa() === $this) {
$grupo->setSolicitudAccionFormativa(null);
}
}
return $this;
}
public function getCurso(): ?Curso
{
return $this->curso;
}
public function setCurso(?Curso $curso): static
{
$this->curso = $curso;
return $this;
}
public function getExpediente(): ?Expediente
{
return $this->expediente;
}
public function setExpediente(?Expediente $expediente): static
{
$this->expediente = $expediente;
return $this;
}
public function getModalidad(): ?Modalidad
{
return $this->modalidad;
}
public function setModalidad(?Modalidad $modalidad): static
{
$this->modalidad = $modalidad;
return $this;
}
/**
* @return Collection<int, UsuarioHermes>
*/
public function getUsuarioHermesFavorito(): Collection
{
return $this->usuarioHermesFavorito;
}
public function addUsuarioHermesFavorito(UsuarioHermes $usuarioHermesFavorito): static
{
if (!$this->usuarioHermesFavorito->contains($usuarioHermesFavorito)) {
$this->usuarioHermesFavorito->add($usuarioHermesFavorito);
$usuarioHermesFavorito->addSolicitudesFavorito($this);
}
return $this;
}
public function removeUsuarioHermesFavorito(UsuarioHermes $usuarioHermesFavorito): static
{
if ($this->usuarioHermesFavorito->removeElement($usuarioHermesFavorito)) {
$usuarioHermesFavorito->removeSolicitudesFavorito($this);
}
return $this;
}
/**
* @return Collection<int, UsuarioHermes>
*/
public function getUsuarioHermesInteres(): Collection
{
return $this->usuarioHermesInteres;
}
public function addUsuarioHermesIntere(UsuarioHermes $usuarioHermesIntere): static
{
if (!$this->usuarioHermesInteres->contains($usuarioHermesIntere)) {
$this->usuarioHermesInteres->add($usuarioHermesIntere);
$usuarioHermesIntere->addSolicitudesIntere($this);
}
return $this;
}
public function removeUsuarioHermesIntere(UsuarioHermes $usuarioHermesIntere): static
{
if ($this->usuarioHermesInteres->removeElement($usuarioHermesIntere)) {
$usuarioHermesIntere->removeSolicitudesIntere($this);
}
return $this;
}
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $horasAulaVirtual = 0;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $horasPresenciales = 0;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $horasTeleformacion = 0;
public function getHorasAulaVirtual(): ?int
{
return $this->horasAulaVirtual;
}
public function setHorasAulaVirtual(?int $horasAulaVirtual): static
{
$this->horasAulaVirtual = $horasAulaVirtual;
return $this;
}
public function getHorasPresenciales(): ?int
{
return $this->horasPresenciales;
}
public function setHorasPresenciales(?int $horasPresenciales): static
{
$this->horasPresenciales = $horasPresenciales;
return $this;
}
public function getHorasTeleformacion(): ?int
{
return $this->horasTeleformacion;
}
public function setHorasTeleformacion(?int $horasTeleformacion): static
{
$this->horasTeleformacion = $horasTeleformacion;
return $this;
}
public function getHorasTotales(): int
{
return $this->getHorasPresenciales()??0 + $this->getHorasTeleformacion()??0 + $this->getHorasAulaVirtual()??0;
}
}