<?php
namespace App\Entity;
use App\Repository\ContadorRepository;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
#[ORM\Table(name: '`contador`')]
#[ORM\Entity(repositoryClass: ContadorRepository::class)]
class Contador extends User
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
private $id;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $matricula;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $domicilio;
#[ORM\Column(type: 'string', length: 20, nullable: true)]
private $telefonoFijo;
#[ORM\Column(type: 'string', length: 20)]
private $celular;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $NombreDelEstudio;
#[ORM\Column(type: 'integer', nullable: true)]
private $id_viejo;
#[ORM\ManyToOne(targetEntity: Localidad::class, inversedBy: 'contadors')]
private $localidad;
#[ORM\ManyToMany(targetEntity: Empresa::class, mappedBy: 'contador')]
private $empresas;
#[ORM\OneToMany(mappedBy: 'contador', targetEntity: SolicitarEmpresa::class)]
private $solicitarEmpresas;
#[ORM\OneToMany(mappedBy: 'contador', targetEntity: InformarPago::class)]
private $informarPagos;
public function __construct()
{
// parent::__construct();
$this->roles[] = 'ROLE_CONTADOR';
$this->empresas = new ArrayCollection();
$this->solicitarEmpresas = new ArrayCollection();
$this->informarPagos = new ArrayCollection();
}
// public function getId(): ?int
// {
// return $this->id;
// }
public function getMatricula(): ?string
{
return $this->matricula;
}
public function setMatricula(?string $matricula): self
{
$this->matricula = $matricula;
return $this;
}
public function getDomicilio(): ?string
{
return $this->domicilio;
}
public function setDomicilio(?string $domicilio): self
{
$this->domicilio = $domicilio;
return $this;
}
public function getTelefonoFijo(): ?string
{
return $this->telefonoFijo;
}
public function setTelefonoFijo(?string $telefonoFijo): self
{
$this->telefonoFijo = $telefonoFijo;
return $this;
}
public function getCelular(): ?string
{
return $this->celular;
}
public function setCelular(string $celular): self
{
$this->celular = $celular;
return $this;
}
public function getNombreDelEstudio(): ?string
{
return $this->NombreDelEstudio;
}
public function setNombreDelEstudio(?string $NombreDelEstudio): self
{
$this->NombreDelEstudio = $NombreDelEstudio;
return $this;
}
public function getLocalidad(): ?Localidad
{
return $this->localidad;
}
public function setLocalidad(?Localidad $localidad): self
{
$this->localidad = $localidad;
return $this;
}
/**
* Get the value of id_viejo
*/
public function getId_viejo()
{
return $this->id_viejo;
}
/**
* Set the value of id_viejo
*
* @return self
*/
public function setId_viejo($id_viejo)
{
$this->id_viejo = $id_viejo;
return $this;
}
/**
* @return Collection<int, Empresa>
*/
public function getEmpresas(): Collection
{
return $this->empresas;
}
public function addEmpresa(Empresa $empresa): self
{
if (!$this->empresas->contains($empresa)) {
$this->empresas[] = $empresa;
$empresa->addContador($this);
}
return $this;
}
public function removeEmpresa(Empresa $empresa): self
{
if ($this->empresas->removeElement($empresa)) {
$empresa->removeContador($this);
}
return $this;
}
/**
* @return Collection<int, SolicitarEmpresa>
*/
public function getSolicitarEmpresas(): Collection
{
return $this->solicitarEmpresas;
}
public function addSolicitarEmpresa(SolicitarEmpresa $solicitarEmpresa): self
{
if (!$this->solicitarEmpresas->contains($solicitarEmpresa)) {
$this->solicitarEmpresas[] = $solicitarEmpresa;
$solicitarEmpresa->setContador($this);
}
return $this;
}
public function removeSolicitarEmpresa(SolicitarEmpresa $solicitarEmpresa): self
{
if ($this->solicitarEmpresas->removeElement($solicitarEmpresa)) {
// set the owning side to null (unless already changed)
if ($solicitarEmpresa->getContador() === $this) {
$solicitarEmpresa->setContador(null);
}
}
return $this;
}
/**
* @return Collection<int, InformarPago>
*/
public function getInformarPagos(): Collection
{
return $this->informarPagos;
}
public function addInformarPago(InformarPago $informarPago): self
{
if (!$this->informarPagos->contains($informarPago)) {
$this->informarPagos[] = $informarPago;
$informarPago->setContador($this);
}
return $this;
}
public function removeInformarPago(InformarPago $informarPago): self
{
if ($this->informarPagos->removeElement($informarPago)) {
// set the owning side to null (unless already changed)
if ($informarPago->getContador() === $this) {
$informarPago->setContador(null);
}
}
return $this;
}
}