<?php
namespace App\Entity;
use App\Repository\EmpresaRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use DateTime;
/**
* @ORM\Entity(repositoryClass=EmpresaRepository::class)
* @ORM\HasLifecycleCallbacks
*/
class Empresa
{
/**
* @ORM\Id()
* @ORM\GeneratedValue()
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=13)
*/
private $ruc;
/**
* @ORM\Column(type="string", length=100)
*/
private $nombre_corto;
/**
* @ORM\Column(type="string", length=100)
*/
private $nombre_largo;
/**
* @ORM\Column(type="string", length=150)
*/
private $servicio;
/**
* @ORM\Column(type="string", length=150)
*/
private $correo;
/**
* @ORM\Column(type="string", length=50)
*/
private $telefono;
/**
* @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="empresa")
*/
private $planoCabeceras;
/**
* @ORM\ManyToOne(targetEntity=Convenio::class, inversedBy="empresas")
*/
private $convenio;
/**
* @ORM\Column(type="string", length=100, nullable=true)
*/
private $canton;
/**
* @ORM\Column(type="string", length=100, nullable=true)
*/
private $provincia;
/**
* @ORM\Column(type="string", length=100, nullable=true)
*/
private $parroquia;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $direccion;
/**
* @ORM\Column(type="string", length=150, nullable=true)
*/
private $correo2;
/**
* @ORM\Column(type="boolean"), options={"default": 0})
*/
private $estado_factura;
/**
* @ORM\Column(type="integer")
*/
private $id_api;
/**
* @ORM\Column(type="text")
*/
private $token;
public function __construct()
{
$this->planoCabeceras = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getRuc(): ?string
{
return $this->ruc;
}
public function setRuc(string $ruc): self
{
$this->ruc = $ruc;
return $this;
}
public function getNombreCorto(): ?string
{
return $this->nombre_corto;
}
public function setNombreCorto(string $nombre_corto): self
{
$this->nombre_corto = $nombre_corto;
return $this;
}
public function getServicio(): ?string
{
return $this->servicio;
}
public function setServicio(string $servicio): self
{
$this->servicio = $servicio;
return $this;
}
public function getCorreo(): ?string
{
return $this->correo;
}
public function setCorreo(string $correo): self
{
$this->correo = $correo;
return $this;
}
public function getTelefono(): ?string
{
return $this->telefono;
}
public function setTelefono(string $telefono): self
{
$this->telefono = $telefono;
return $this;
}
public function getNombreLargo(): ?string
{
return $this->nombre_largo;
}
public function setNombreLargo(string $nombre_largo): self
{
$this->nombre_largo = $nombre_largo;
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;
}
/**
* @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->setEmpresa($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->getEmpresa() === $this) {
$planoCabecera->setEmpresa(null);
}
}
return $this;
}
public function __toString(){
// to show the name of the Category in the select
return $this->nombre_largo;
// to show the id of the Category in the select
// return $this->id;
}
public function getConvenio(): ?Convenio
{
return $this->convenio;
}
public function setConvenio(?Convenio $convenio): self
{
$this->convenio = $convenio;
return $this;
}
public function getCanton(): ?string
{
return $this->canton;
}
public function setCanton(?string $canton): self
{
$this->canton = $canton;
return $this;
}
public function getProvincia(): ?string
{
return $this->provincia;
}
public function setProvincia(?string $provincia): self
{
$this->provincia = $provincia;
return $this;
}
public function getParroquia(): ?string
{
return $this->parroquia;
}
public function setParroquia(?string $parroquia): self
{
$this->parroquia = $parroquia;
return $this;
}
public function getDireccion(): ?string
{
return $this->direccion;
}
public function setDireccion(?string $direccion): self
{
$this->direccion = $direccion;
return $this;
}
public function getCorreo2(): ?string
{
return $this->correo2;
}
public function setCorreo2(?string $correo2): self
{
$this->correo2 = $correo2;
return $this;
}
public function getEstadoFactura(): ?bool
{
return $this->estado_factura;
}
public function setEstadoFactura(bool $estado_factura): self
{
$this->estado_factura = $estado_factura;
return $this;
}
public function getIdApi(): ?int
{
return $this->id_api;
}
public function setIdApi(int $id_api): self
{
$this->id_api = $id_api;
return $this;
}
public function getToken(): ?string
{
return $this->token;
}
public function setToken(string $token): self
{
$this->token = $token;
return $this;
}
}