src/Entity/Empresa.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\EmpresaRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use DateTime;
  8. /**
  9.  * @ORM\Entity(repositoryClass=EmpresaRepository::class)
  10.  * @ORM\HasLifecycleCallbacks
  11.  */
  12. class Empresa
  13. {
  14.     /**
  15.      * @ORM\Id()
  16.      * @ORM\GeneratedValue()
  17.      * @ORM\Column(type="integer")
  18.      */
  19.     private $id;
  20.     /**
  21.      * @ORM\Column(type="string", length=13)
  22.      */
  23.     private $ruc;
  24.     /**
  25.      * @ORM\Column(type="string", length=100)
  26.      */
  27.     private $nombre_corto;
  28.     /**
  29.      * @ORM\Column(type="string", length=100)
  30.      */
  31.     private $nombre_largo;
  32.     /**
  33.      * @ORM\Column(type="string", length=150)
  34.      */
  35.     private $servicio;
  36.     /**
  37.      * @ORM\Column(type="string", length=150)
  38.      */
  39.     private $correo;
  40.     /**
  41.      * @ORM\Column(type="string", length=50)
  42.      */
  43.     private $telefono;
  44.     /**
  45.      * @ORM\Column(type="boolean")
  46.      */
  47.     private $estado;
  48.     /**
  49.      * @ORM\Column(type="datetime")
  50.      */
  51.     private $created_at;
  52.     /**
  53.      * @ORM\Column(type="datetime")
  54.      */
  55.     private $updated_at;
  56.     /**
  57.      * @ORM\OneToMany(targetEntity=PlanoCabecera::class, mappedBy="empresa")
  58.      */
  59.     private $planoCabeceras;
  60.     /**
  61.      * @ORM\ManyToOne(targetEntity=Convenio::class, inversedBy="empresas")
  62.      */
  63.     private $convenio;
  64.     /**
  65.      * @ORM\Column(type="string", length=100, nullable=true)
  66.      */
  67.     private $canton;
  68.     /**
  69.      * @ORM\Column(type="string", length=100, nullable=true)
  70.      */
  71.     private $provincia;
  72.     /**
  73.      * @ORM\Column(type="string", length=100, nullable=true)
  74.      */
  75.     private $parroquia;
  76.     /**
  77.      * @ORM\Column(type="string", length=255, nullable=true)
  78.      */
  79.     private $direccion;
  80.     
  81.     /**
  82.      * @ORM\Column(type="string", length=150, nullable=true)
  83.      */
  84.     private $correo2;
  85.         /**
  86.      * @ORM\Column(type="boolean"), options={"default": 0})
  87.      */
  88.     private $estado_factura;
  89.     /**
  90.      * @ORM\Column(type="integer")
  91.      */
  92.     private $id_api;
  93.     /**
  94.      * @ORM\Column(type="text")
  95.      */
  96.     private $token;
  97.     public function __construct()
  98.     {
  99.         $this->planoCabeceras = new ArrayCollection();
  100.     }
  101.     public function getId(): ?int
  102.     {
  103.         return $this->id;
  104.     }
  105.     public function getRuc(): ?string
  106.     {
  107.         return $this->ruc;
  108.     }
  109.     public function setRuc(string $ruc): self
  110.     {
  111.         $this->ruc $ruc;
  112.         return $this;
  113.     }
  114.     public function getNombreCorto(): ?string
  115.     {
  116.         return $this->nombre_corto;
  117.     }
  118.     public function setNombreCorto(string $nombre_corto): self
  119.     {
  120.         $this->nombre_corto $nombre_corto;
  121.         return $this;
  122.     }
  123.     public function getServicio(): ?string
  124.     {
  125.         return $this->servicio;
  126.     }
  127.     public function setServicio(string $servicio): self
  128.     {
  129.         $this->servicio $servicio;
  130.         return $this;
  131.     }
  132.     public function getCorreo(): ?string
  133.     {
  134.         return $this->correo;
  135.     }
  136.     public function setCorreo(string $correo): self
  137.     {
  138.         $this->correo $correo;
  139.         return $this;
  140.     }
  141.     public function getTelefono(): ?string
  142.     {
  143.         return $this->telefono;
  144.     }
  145.     public function setTelefono(string $telefono): self
  146.     {
  147.         $this->telefono $telefono;
  148.         return $this;
  149.     }
  150.     public function getNombreLargo(): ?string
  151.     {
  152.         return $this->nombre_largo;
  153.     }
  154.     public function setNombreLargo(string $nombre_largo): self
  155.     {
  156.         $this->nombre_largo $nombre_largo;
  157.         return $this;
  158.     }
  159.     public function getEstado(): ?bool
  160.     {
  161.         return $this->estado;
  162.     }
  163.     public function setEstado(bool $estado): self
  164.     {
  165.         $this->estado $estado;
  166.         return $this;
  167.     }
  168.     public function getCreatedAt(): ?\DateTimeInterface
  169.     {
  170.         return $this->created_at;
  171.     }
  172.     public function setCreatedAt(\DateTimeInterface $created_at): self
  173.     {
  174.         $this->created_at $created_at;
  175.         return $this;
  176.     }
  177.     public function getUpdatedAt(): ?\DateTimeInterface
  178.     {
  179.         return $this->updated_at;
  180.     }
  181.     public function setUpdatedAt(\DateTimeInterface $updated_at): self
  182.     {
  183.         $this->updated_at $updated_at;
  184.         return $this;
  185.     }
  186.     /**
  187.      * @ORM\PrePersist
  188.      * @ORM\PreUpdate
  189.      */
  190.     public function updatedTimestamps(): void
  191.     {
  192.         $dateTimeNow = new DateTime('now');
  193.         $this->setUpdatedAt($dateTimeNow);
  194.         if ($this->getCreatedAt() === null) {
  195.             $this->setCreatedAt($dateTimeNow);
  196.         }
  197.     }
  198.     /**
  199.      * @return Collection|PlanoCabecera[]
  200.      */
  201.     public function getPlanoCabeceras(): Collection
  202.     {
  203.         return $this->planoCabeceras;
  204.     }
  205.     public function addPlanoCabecera(PlanoCabecera $planoCabecera): self
  206.     {
  207.         if (!$this->planoCabeceras->contains($planoCabecera)) {
  208.             $this->planoCabeceras[] = $planoCabecera;
  209.             $planoCabecera->setEmpresa($this);
  210.         }
  211.         return $this;
  212.     }
  213.     public function removePlanoCabecera(PlanoCabecera $planoCabecera): self
  214.     {
  215.         if ($this->planoCabeceras->contains($planoCabecera)) {
  216.             $this->planoCabeceras->removeElement($planoCabecera);
  217.             // set the owning side to null (unless already changed)
  218.             if ($planoCabecera->getEmpresa() === $this) {
  219.                 $planoCabecera->setEmpresa(null);
  220.             }
  221.         }
  222.         return $this;
  223.     }
  224.     public function __toString(){
  225.         // to show the name of the Category in the select
  226.         return $this->nombre_largo;
  227.         // to show the id of the Category in the select
  228.         // return $this->id;
  229.     }
  230.     public function getConvenio(): ?Convenio
  231.     {
  232.         return $this->convenio;
  233.     }
  234.     public function setConvenio(?Convenio $convenio): self
  235.     {
  236.         $this->convenio $convenio;
  237.         return $this;
  238.     }
  239.     public function getCanton(): ?string
  240.     {
  241.         return $this->canton;
  242.     }
  243.     public function setCanton(?string $canton): self
  244.     {
  245.         $this->canton $canton;
  246.         return $this;
  247.     }
  248.     public function getProvincia(): ?string
  249.     {
  250.         return $this->provincia;
  251.     }
  252.     public function setProvincia(?string $provincia): self
  253.     {
  254.         $this->provincia $provincia;
  255.         return $this;
  256.     }
  257.     public function getParroquia(): ?string
  258.     {
  259.         return $this->parroquia;
  260.     }
  261.     public function setParroquia(?string $parroquia): self
  262.     {
  263.         $this->parroquia $parroquia;
  264.         return $this;
  265.     }
  266.     public function getDireccion(): ?string
  267.     {
  268.         return $this->direccion;
  269.     }
  270.     public function setDireccion(?string $direccion): self
  271.     {
  272.         $this->direccion $direccion;
  273.         return $this;
  274.     }
  275.     
  276.     public function getCorreo2(): ?string
  277.     {
  278.         return $this->correo2;
  279.     }
  280.     public function setCorreo2(?string $correo2): self
  281.     {
  282.         $this->correo2 $correo2;
  283.         return $this;
  284.     }
  285.     public function getEstadoFactura(): ?bool
  286.     {
  287.         return $this->estado_factura;
  288.     }
  289.     public function setEstadoFactura(bool $estado_factura): self
  290.     {
  291.         $this->estado_factura $estado_factura;
  292.         return $this;
  293.     }
  294.     public function getIdApi(): ?int
  295.     {
  296.         return $this->id_api;
  297.     }
  298.     public function setIdApi(int $id_api): self
  299.     {
  300.         $this->id_api $id_api;
  301.         return $this;
  302.     }
  303.     public function getToken(): ?string
  304.     {
  305.         return $this->token;
  306.     }
  307.     public function setToken(string $token): self
  308.     {
  309.         $this->token $token;
  310.         return $this;
  311.     }
  312. }