<?php
namespace App\Entity;
use App\Repository\EmpleadoRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
#[ORM\Entity(repositoryClass: EmpleadoRepository::class)]
#[UniqueEntity(fields: ['dni'], message: 'Ya existe un empleado con ese DNI.')]
#[UniqueEntity(fields: ['cuil'], message: 'Ya existe una empleado con ese CUIL.')]
class Empleado
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
private $id;
#[ORM\Column(type: 'string', length: 255)]
private $nombre;
#[ORM\Column(type: 'string', length: 255)]
private $apellido;
#[ORM\Column(name: 'dni', type: 'string', length: 8, unique:true)]
private $dni;
#[ORM\Column(name: 'cuil', type: 'string', length: 11, unique:true)]
private $cuil;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $email;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $horarioLaboral;//x
#[ORM\Column(type: 'datetime', nullable: true)]
private $fechaNacimiento;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $nacionalidad;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $provincia;
#[ORM\ManyToOne(targetEntity: Localidad::class, inversedBy: 'empleados')]
private $localidad;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $domicilio;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $telefono;
#[ORM\Column(type: 'text', nullable: true)]
private $motivo;
#[ORM\Column(type: 'datetime', nullable: true)]
private $fechaAltaAfip;
#[ORM\Column(type: 'datetime', nullable: true)]
private $fechaLimiteMutual;
#[ORM\Column(type: 'datetime', nullable: true)]
private $fechaLimiteObraSocial;
#[ORM\Column(type: 'integer', nullable: true)]
private $horasTrabajadas;//x
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $horasTrabajadasDeclaradaPorEmpleado;
#[ORM\Column(type: 'integer', nullable: true)]
private $horasTrabajadasAcuerdo;
#[ORM\Column(type: 'datetime', nullable: true)]
private $fechaIngresoTrabajar;
#[ORM\Column(type: 'datetime', nullable: true)]
private $fechaIngresoTrabajarAcuerdo;
#[ORM\Column(type: 'datetime', nullable: true)]
private $fechaEgresoAcuerdo;
#[ORM\Column(type: 'datetime', nullable: true)]
private $fechaIngresoSindicato;
#[ORM\Column(type: 'decimal', precision: 10, scale: 2, nullable: true)]
private $remuneracion;//x
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $estadoCivil;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $harina;
#[ORM\ManyToOne(targetEntity: Empresa::class, inversedBy: 'empleados')]
private $empresa;//x
#[ORM\Column(type: 'boolean', nullable: true)]
private $otraObraSocial;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $sexo;
#[ORM\Column(type: 'datetime', nullable: true)]
private $fechaBaja;//x
#[ORM\Column(type: 'integer', nullable: true)]
private $caja;
#[ORM\Column(type: 'boolean', nullable: true)]
private $presentismo;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $foto;
#[ORM\Column(type: 'decimal', precision: 10, scale: 2, nullable: true)]
private $aguinaldo;
#[ORM\Column(type: 'datetime', nullable: true)]
private $fechaRegister;
#[ORM\Column(type: 'boolean', nullable: true)]
private $afiliado;
#[ORM\Column(type: 'datetime', nullable: true)]
private $fechaAltaTemprana;
#[ORM\ManyToOne(targetEntity: Sucursal::class, inversedBy: 'empleado')]
private $sucursal;//x
#[ORM\OneToMany(mappedBy: 'empleado', targetEntity: Observacion::class)]
private $observacions;
#[ORM\ManyToOne(targetEntity: User::class, inversedBy: 'empleado')]
private $userCargo;//x lo puedo dejar
#[ORM\Column(type: 'boolean', nullable: true)]
private $isActive;
#[ORM\ManyToOne(targetEntity: Cargo::class, inversedBy: 'empleado')]
private $cargo;//x
#[ORM\ManyToOne(targetEntity: Cargo::class, inversedBy: 'empleados')]
private $cargoAcuerdo;
#[ORM\OneToMany(mappedBy: 'empleado', targetEntity: Familiar::class)]
private $familiars;
#[ORM\OneToMany(mappedBy: 'empleado', targetEntity: EmpleadoBeneficio::class)]
private $empleadoBeneficios;
#[ORM\ManyToOne(targetEntity: MotivoLiquidacionEmpleado::class, inversedBy: 'empleado')]
private $motivoLiquidacionEmpleado;
#[ORM\OneToMany(mappedBy: 'empleado', targetEntity: EmpleadoBoleta::class)]
private $empleadoBoletas;
#[ORM\ManyToMany(targetEntity: AcuerdoDePago::class, mappedBy: 'empleados')]
private $acuerdoDePagos;
//no va
#[ORM\ManyToMany(targetEntity: EscalaSalarial::class, mappedBy: 'empleado')]
private $escalaSalarialAcuerdo;
#[ORM\OneToMany(mappedBy: 'empleado', targetEntity: EmpleadoRecibo::class)]
private Collection $empleadoRecibos;
#[ORM\OneToMany(mappedBy: 'empleado', targetEntity: EmpleadoEmpresaSucursal::class)]
private Collection $empleadoEmpresaSucursals;
#[ORM\ManyToMany(targetEntity: Concepto::class, inversedBy: 'empleados')]
private Collection $concepto;
public function __construct()
{
$this->observacions = new ArrayCollection();
$this->familiars = new ArrayCollection();
$this->empleadoBeneficios = new ArrayCollection();
$this->empleadoBoletas = new ArrayCollection();
$this->acuerdoDePagos = new ArrayCollection();
$this->escalaSalarialAcuerdo = new ArrayCollection();
$this->empleadoRecibos = new ArrayCollection();
$this->empleadoEmpresaSucursals = new ArrayCollection();
$this->concepto = 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 getApellido(): ?string
{
return $this->apellido;
}
public function setApellido(string $apellido): self
{
$this->apellido = $apellido;
return $this;
}
public function getDni(): ?string
{
return $this->dni;
}
public function setDni(string $dni): self
{
$this->dni = $dni;
return $this;
}
public function getCuil(): ?string
{
return $this->cuil;
}
public function setCuil(string $cuil): self
{
$this->cuil = $cuil;
return $this;
}
public function getEmail(): ?string
{
return $this->email;
}
public function setEmail(?string $email): self
{
$this->email = $email;
return $this;
}
public function getHorarioLaboral(): ?string
{
return $this->horarioLaboral;
}
public function setHorarioLaboral(?string $horarioLaboral): self
{
$this->horarioLaboral = $horarioLaboral;
return $this;
}
public function getFechaNacimiento(): ?\DateTimeInterface
{
return $this->fechaNacimiento;
}
public function setFechaNacimiento(?\DateTimeInterface $fechaNacimiento): self
{
$this->fechaNacimiento = $fechaNacimiento;
return $this;
}
public function getNacionalidad(): ?string
{
return $this->nacionalidad;
}
public function setNacionalidad(?string $nacionalidad): self
{
$this->nacionalidad = $nacionalidad;
return $this;
}
public function getProvincia(): ?string
{
return $this->provincia;
}
public function setProvincia(?string $provincia): self
{
$this->provincia = $provincia;
return $this;
}
public function getLocalidad(): ?Localidad
{
return $this->localidad;
}
public function setLocalidad(?Localidad $localidad): self
{
$this->localidad = $localidad;
return $this;
}
public function getDomicilio(): ?string
{
return $this->domicilio;
}
public function setDomicilio(?string $domicilio): self
{
$this->domicilio = $domicilio;
return $this;
}
public function getTelefono(): ?string
{
return $this->telefono;
}
public function setTelefono(?string $telefono): self
{
$this->telefono = $telefono;
return $this;
}
public function getFechaAltaAfip(): ?\DateTimeInterface
{
return $this->fechaAltaAfip;
}
public function setFechaAltaAfip(?\DateTimeInterface $fechaAltaAfip): self
{
$this->fechaAltaAfip = $fechaAltaAfip;
return $this;
}
public function getFechaLimiteMutual(): ?\DateTimeInterface
{
return $this->fechaLimiteMutual;
}
public function setFechaLimiteMutual(?\DateTimeInterface $fechaLimiteMutual): self
{
$this->fechaLimiteMutual = $fechaLimiteMutual;
return $this;
}
public function getFechaLimiteObraSocial(): ?\DateTimeInterface
{
return $this->fechaLimiteObraSocial;
}
public function setFechaLimiteObraSocial(?\DateTimeInterface $fechaLimiteObraSocial): self
{
$this->fechaLimiteObraSocial = $fechaLimiteObraSocial;
return $this;
}
public function getHorasTrabajadas(): ?int
{
return $this->horasTrabajadas;
}
public function setHorasTrabajadas(?int $horasTrabajadas): self
{
$this->horasTrabajadas = $horasTrabajadas;
return $this;
}
public function getHorasTrabajadasAcuerdo(): ?int
{
return $this->horasTrabajadasAcuerdo;
}
public function setHorasTrabajadasAcuerdo(?int $horasTrabajadasAcuerdo): self
{
$this->horasTrabajadasAcuerdo = $horasTrabajadasAcuerdo;
return $this;
}
public function getFechaIngresoTrabajar(): ?\DateTimeInterface
{
return $this->fechaIngresoTrabajar;
}
public function setFechaIngresoTrabajar(?\DateTimeInterface $fechaIngresoTrabajar): self
{
$this->fechaIngresoTrabajar = $fechaIngresoTrabajar;
return $this;
}
public function getFechaIngresoTrabajarAcuerdo(): ?\DateTimeInterface
{
return $this->fechaIngresoTrabajarAcuerdo;
}
public function setFechaIngresoTrabajarAcuerdo(?\DateTimeInterface $fechaIngresoTrabajarAcuerdo): self
{
$this->fechaIngresoTrabajarAcuerdo = $fechaIngresoTrabajarAcuerdo;
return $this;
}
public function getFechaEgresoAcuerdo(): ?\DateTimeInterface
{
return $this->fechaEgresoAcuerdo;
}
public function setFechaEgresoAcuerdo(?\DateTimeInterface $fechaEgresoAcuerdo): self
{
$this->fechaEgresoAcuerdo = $fechaEgresoAcuerdo;
return $this;
}
public function getFechaIngresoSindicato(): ?\DateTimeInterface
{
return $this->fechaIngresoSindicato;
}
public function setFechaIngresoSindicato(?\DateTimeInterface $fechaIngresoSindicato): self
{
$this->fechaIngresoSindicato = $fechaIngresoSindicato;
return $this;
}
public function getRemuneracion(): ?string
{
return $this->remuneracion;
}
public function setRemuneracion(?string $remuneracion): self
{
$this->remuneracion = $remuneracion;
return $this;
}
public function getEstadoCivil(): ?string
{
return $this->estadoCivil;
}
public function setEstadoCivil(?string $estadoCivil): self
{
$this->estadoCivil = $estadoCivil;
return $this;
}
public function getHarina(): ?string
{
return $this->harina;
}
public function setHarina(?string $harina): self
{
$this->harina = $harina;
return $this;
}
public function getEmpresa(): ?Empresa
{
return $this->empresa;
}
public function setEmpresa(?Empresa $empresa): self
{
$this->empresa = $empresa;
return $this;
}
public function getOtraObraSocial(): ?bool
{
return $this->otraObraSocial;
}
public function setOtraObraSocial(?bool $otraObraSocial): self
{
$this->otraObraSocial = $otraObraSocial;
return $this;
}
public function getSexo(): ?string
{
return $this->sexo;
}
public function setSexo(?string $sexo): self
{
$this->sexo = $sexo;
return $this;
}
public function getFechaBaja(): ?\DateTimeInterface
{
return $this->fechaBaja;
}
public function setFechaBaja(?\DateTimeInterface $fechaBaja): self
{
$this->fechaBaja = $fechaBaja;
return $this;
}
public function getCaja(): ?int
{
return $this->caja;
}
public function setCaja(?int $caja): self
{
$this->caja = $caja;
return $this;
}
public function getPresentismo(): ?bool
{
return $this->presentismo;
}
public function setPresentismo(?bool $presentismo): self
{
$this->presentismo = $presentismo;
return $this;
}
public function getFoto(): ?string
{
return $this->foto;
}
public function setFoto(?string $foto): self
{
$this->foto = $foto;
return $this;
}
public function getAguinaldo(): ?string
{
return $this->aguinaldo;
}
public function setAguinaldo(?string $aguinaldo): self
{
$this->aguinaldo = $aguinaldo;
return $this;
}
public function getFechaRegister(): ?\DateTimeInterface
{
return $this->fechaRegister;
}
public function setFechaRegister(?\DateTimeInterface $fechaRegister): self
{
$this->fechaRegister = $fechaRegister;
return $this;
}
public function getAfiliado(): ?bool
{
return $this->afiliado;
}
public function setAfiliado(?bool $afiliado): self
{
$this->afiliado = $afiliado;
return $this;
}
public function getSucursal(): ?Sucursal
{
return $this->sucursal;
}
public function setSucursal(?Sucursal $sucursal): self
{
$this->sucursal = $sucursal;
return $this;
}
/**
* @return Collection<int, Observacion>
*/
public function getObservacions(): Collection
{
return $this->observacions;
}
public function addObservacion(Observacion $observacion): self
{
if (!$this->observacions->contains($observacion)) {
$this->observacions[] = $observacion;
$observacion->setEmpleado($this);
}
return $this;
}
public function removeObservacion(Observacion $observacion): self
{
if ($this->observacions->removeElement($observacion)) {
// set the owning side to null (unless already changed)
if ($observacion->getEmpleado() === $this) {
$observacion->setEmpleado(null);
}
}
return $this;
}
/**
* Get the value of userCargo
*/
public function getUserCargo(): ?User
{
return $this->userCargo;
}
/**
* Set the value of userCargo
*
* @return self
*/
public function setUserCargo(?User $userCargo)
{
$this->userCargo = $userCargo;
return $this;
}
/**
* Get the value of isActive
*/
public function getIsActive()
{
return $this->isActive;
}
/**
* Set the value of isActive
*
* @return self
*/
public function setIsActive($isActive)
{
$this->isActive = $isActive;
return $this;
}
/**
* Get the value of cargo
*/
public function getCargo(): ?Cargo
{
return $this->cargo;
}
/**
* Set the value of cargo
*/
public function setCargo(?Cargo $cargo): self
{
$this->cargo = $cargo;
return $this;
}
/**
* Get the value of cargo
*/
public function getCargoAcuerdo(): ?Cargo
{
return $this->cargoAcuerdo;
}
/**
* Set the value of cargo
*/
public function setCargoAcuerdo(?Cargo $cargoAcuerdo): self
{
$this->cargoAcuerdo = $cargoAcuerdo;
return $this;
}
/**
* Get the value of motivo
*/
public function getMotivo()
{
return $this->motivo;
}
/**
* Set the value of motivo
*
* @return self
*/
public function setMotivo($motivo)
{
$this->motivo = $motivo;
return $this;
}
/**
* @return Collection<int, Familiar>
*/
public function getFamiliars(): Collection
{
return $this->familiars;
}
public function addFamiliar(Familiar $familiar): self
{
if (!$this->familiars->contains($familiar)) {
$this->familiars[] = $familiar;
$familiar->setEmpleado($this);
}
return $this;
}
public function removeFamiliar(Familiar $familiar): self
{
if ($this->familiars->removeElement($familiar)) {
// set the owning side to null (unless already changed)
if ($familiar->getEmpleado() === $this) {
$familiar->setEmpleado(null);
}
}
return $this;
}
/**
* @return Collection<int, EmpleadoBeneficio>
*/
public function getEmpleadoBeneficios(): Collection
{
return $this->empleadoBeneficios;
}
public function addEmpleadoBeneficio(EmpleadoBeneficio $empleadoBeneficio): self
{
if (!$this->empleadoBeneficios->contains($empleadoBeneficio)) {
$this->empleadoBeneficios[] = $empleadoBeneficio;
$empleadoBeneficio->setEmpleado($this);
}
return $this;
}
public function removeEmpleadoBeneficio(EmpleadoBeneficio $empleadoBeneficio): self
{
if ($this->empleadoBeneficios->removeElement($empleadoBeneficio)) {
// set the owning side to null (unless already changed)
if ($empleadoBeneficio->getEmpleado() === $this) {
$empleadoBeneficio->setEmpleado(null);
}
}
return $this;
}
public function __toString() {
return $this->getNombre();
}
public function getMotivoLiquidacionEmpleado(): ?MotivoLiquidacionEmpleado
{
return $this->motivoLiquidacionEmpleado;
}
public function setMotivoLiquidacionEmpleado(?MotivoLiquidacionEmpleado $motivoLiquidacionEmpleado): self
{
$this->motivoLiquidacionEmpleado = $motivoLiquidacionEmpleado;
return $this;
}
/**
* @return Collection<int, EmpleadoBoleta>
*/
public function getEmpleadoBoletas(): Collection
{
return $this->empleadoBoletas;
}
public function addEmpleadoBoleta(EmpleadoBoleta $empleadoBoleta): self
{
if (!$this->empleadoBoletas->contains($empleadoBoleta)) {
$this->empleadoBoletas[] = $empleadoBoleta;
$empleadoBoleta->setEmpleado($this);
}
return $this;
}
public function removeEmpleadoBoleta(EmpleadoBoleta $empleadoBoleta): self
{
if ($this->empleadoBoletas->removeElement($empleadoBoleta)) {
// set the owning side to null (unless already changed)
if ($empleadoBoleta->getEmpleado() === $this) {
$empleadoBoleta->setEmpleado(null);
}
}
return $this;
}
/**
* @return Collection<int, AcuerdoDePago>
*/
public function getAcuerdoDePagos(): Collection
{
return $this->acuerdoDePagos;
}
public function addAcuerdoDePago(AcuerdoDePago $acuerdoDePago): self
{
if (!$this->acuerdoDePagos->contains($acuerdoDePago)) {
$this->acuerdoDePagos[] = $acuerdoDePago;
$acuerdoDePago->addEmpleado($this);
}
return $this;
}
public function removeAcuerdoDePago(AcuerdoDePago $acuerdoDePago): self
{
if ($this->acuerdoDePagos->removeElement($acuerdoDePago)) {
$acuerdoDePago->removeEmpleado($this);
}
return $this;
}
/**
* @return Collection|EscalaSalarial[]
*/
public function getEscalaSalarialAcuerdo(): Collection
{
return $this->escalaSalarialAcuerdo;
}
public function addEscalaSalarialAcuerdo(EscalaSalarial $escalaSalarialAcuerdo): self
{
if (!$this->escalaSalarialAcuerdo->contains($escalaSalarialAcuerdo)) {
$this->escalaSalarialAcuerdo[] = $escalaSalarialAcuerdo;
$escalaSalarialAcuerdo->addEmpleado($this);
}
return $this;
}
public function removeEscalaSalarialAcuerdo(EscalaSalarial $escalaSalarialAcuerdo): self
{
if ($this->escalaSalarialAcuerdo->removeElement($escalaSalarialAcuerdo)) {
$escalaSalarialAcuerdo->removeEmpleado($this);
}
return $this;
}
/**
* Get the value of horasTrabajadasDeclaradaPorEmpleado
*/
public function getHorasTrabajadasDeclaradaPorEmpleado()
{
return $this->horasTrabajadasDeclaradaPorEmpleado;
}
/**
* Set the value of horasTrabajadasDeclaradaPorEmpleado
*
* @return self
*/
public function setHorasTrabajadasDeclaradaPorEmpleado($horasTrabajadasDeclaradaPorEmpleado)
{
$this->horasTrabajadasDeclaradaPorEmpleado = $horasTrabajadasDeclaradaPorEmpleado;
return $this;
}
/**
* @return Collection<int, EmpleadoRecibo>
*/
public function getEmpleadoRecibos(): Collection
{
return $this->empleadoRecibos;
}
public function addEmpleadoRecibo(EmpleadoRecibo $empleadoRecibo): self
{
if (!$this->empleadoRecibos->contains($empleadoRecibo)) {
$this->empleadoRecibos->add($empleadoRecibo);
$empleadoRecibo->setEmpleado($this);
}
return $this;
}
public function removeEmpleadoRecibo(EmpleadoRecibo $empleadoRecibo): self
{
if ($this->empleadoRecibos->removeElement($empleadoRecibo)) {
// set the owning side to null (unless already changed)
if ($empleadoRecibo->getEmpleado() === $this) {
$empleadoRecibo->setEmpleado(null);
}
}
return $this;
}
/**
* @return Collection<int, EmpleadoEmpresaSucursal>
*/
public function getEmpleadoEmpresaSucursals(): Collection
{
return $this->empleadoEmpresaSucursals;
}
public function addEmpleadoEmpresaSucursal(EmpleadoEmpresaSucursal $empleadoEmpresaSucursal): self
{
if (!$this->empleadoEmpresaSucursals->contains($empleadoEmpresaSucursal)) {
$this->empleadoEmpresaSucursals->add($empleadoEmpresaSucursal);
$empleadoEmpresaSucursal->setEmpleado($this);
}
return $this;
}
public function removeEmpleadoEmpresaSucursal(EmpleadoEmpresaSucursal $empleadoEmpresaSucursal): self
{
if ($this->empleadoEmpresaSucursals->removeElement($empleadoEmpresaSucursal)) {
// set the owning side to null (unless already changed)
if ($empleadoEmpresaSucursal->getEmpleado() === $this) {
$empleadoEmpresaSucursal->setEmpleado(null);
}
}
return $this;
}
/**
* @return Collection<int, Concepto>
*/
public function getConcepto(): Collection
{
return $this->concepto;
}
public function addConcepto(Concepto $concepto): self
{
if (!$this->concepto->contains($concepto)) {
$this->concepto->add($concepto);
}
return $this;
}
public function removeConcepto(Concepto $concepto): self
{
$this->concepto->removeElement($concepto);
return $this;
}
public function getFechaAltaTemprana(): ?\DateTimeInterface
{
return $this->fechaAltaTemprana;
}
public function setFechaAltaTemprana(?\DateTimeInterface $fechaAltaTemprana): self
{
$this->fechaAltaTemprana = $fechaAltaTemprana;
return $this;
}
}