src/Entity/Convenio.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ConvenioRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=ConvenioRepository::class)
  9.  */
  10. class Convenio
  11. {
  12.     /**
  13.      * @ORM\Id()
  14.      * @ORM\GeneratedValue()
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\Column(type="string", length=100)
  20.      */
  21.     private $nombre;
  22.     /**
  23.      * @ORM\Column(type="boolean")
  24.      */
  25.     private $estado;
  26.     /**
  27.      * @ORM\Column(type="datetime")
  28.      */
  29.     private $created_at;
  30.     /**
  31.      * @ORM\Column(type="datetime")
  32.      */
  33.     private $updated_at;
  34.     /**
  35.      * @ORM\OneToMany(targetEntity=ItemConvenios::class, mappedBy="convenio")
  36.      */
  37.     private $itemConvenios;
  38.     /**
  39.      * @ORM\OneToMany(targetEntity=PlanoDetalle::class, mappedBy="convenio")
  40.      */
  41.     private $planoDetalles;
  42.     /**
  43.      * @ORM\OneToMany(targetEntity=Empresa::class, mappedBy="convenio")
  44.      */
  45.     private $empresas;
  46.     public function __construct()
  47.     {
  48.         $this->itemConvenios = new ArrayCollection();
  49.         $this->planoDetalles = new ArrayCollection();
  50.         $this->empresas = new ArrayCollection();
  51.     }
  52.     public function getId(): ?int
  53.     {
  54.         return $this->id;
  55.     }
  56.     public function getNombre(): ?string
  57.     {
  58.         return $this->nombre;
  59.     }
  60.     public function setNombre(string $nombre): self
  61.     {
  62.         $this->nombre $nombre;
  63.         return $this;
  64.     }
  65.     public function getEstado(): ?bool
  66.     {
  67.         return $this->estado;
  68.     }
  69.     public function setEstado(bool $estado): self
  70.     {
  71.         $this->estado $estado;
  72.         return $this;
  73.     }
  74.     public function getCreatedAt(): ?\DateTimeInterface
  75.     {
  76.         return $this->created_at;
  77.     }
  78.     public function setCreatedAt(\DateTimeInterface $created_at): self
  79.     {
  80.         $this->created_at $created_at;
  81.         return $this;
  82.     }
  83.     public function getUpdatedAt(): ?\DateTimeInterface
  84.     {
  85.         return $this->updated_at;
  86.     }
  87.     public function setUpdatedAt(\DateTimeInterface $updated_at): self
  88.     {
  89.         $this->updated_at $updated_at;
  90.         return $this;
  91.     }
  92.     /**
  93.      * Generates the magic method
  94.      *
  95.      */
  96.     public function __toString(){
  97.         // to show the name of the Category in the select
  98.         return $this->nombre;
  99.         // to show the id of the Category in the select
  100.         // return $this->id;
  101.     }
  102.     /**
  103.      * @return Collection|ItemConvenios[]
  104.      */
  105.     public function getItemConvenios(): Collection
  106.     {
  107.         return $this->itemConvenios;
  108.     }
  109.     public function addItemConvenio(ItemConvenios $itemConvenio): self
  110.     {
  111.         if (!$this->itemConvenios->contains($itemConvenio)) {
  112.             $this->itemConvenios[] = $itemConvenio;
  113.             $itemConvenio->setConvenio($this);
  114.         }
  115.         return $this;
  116.     }
  117.     public function removeItemConvenio(ItemConvenios $itemConvenio): self
  118.     {
  119.         if ($this->itemConvenios->contains($itemConvenio)) {
  120.             $this->itemConvenios->removeElement($itemConvenio);
  121.             // set the owning side to null (unless already changed)
  122.             if ($itemConvenio->getConvenio() === $this) {
  123.                 $itemConvenio->setConvenio(null);
  124.             }
  125.         }
  126.         return $this;
  127.     }
  128.     /**
  129.      * @return Collection|PlanoDetalle[]
  130.      */
  131.     public function getPlanoDetalles(): Collection
  132.     {
  133.         return $this->planoDetalles;
  134.     }
  135.     public function addPlanoDetalle(PlanoDetalle $planoDetalle): self
  136.     {
  137.         if (!$this->planoDetalles->contains($planoDetalle)) {
  138.             $this->planoDetalles[] = $planoDetalle;
  139.             $planoDetalle->setConvenio($this);
  140.         }
  141.         return $this;
  142.     }
  143.     public function removePlanoDetalle(PlanoDetalle $planoDetalle): self
  144.     {
  145.         if ($this->planoDetalles->contains($planoDetalle)) {
  146.             $this->planoDetalles->removeElement($planoDetalle);
  147.             // set the owning side to null (unless already changed)
  148.             if ($planoDetalle->getConvenio() === $this) {
  149.                 $planoDetalle->setConvenio(null);
  150.             }
  151.         }
  152.         return $this;
  153.     }
  154.     /**
  155.      * @return Collection|Empresa[]
  156.      */
  157.     public function getEmpresas(): Collection
  158.     {
  159.         return $this->empresas;
  160.     }
  161.     public function addEmpresa(Empresa $empresa): self
  162.     {
  163.         if (!$this->empresas->contains($empresa)) {
  164.             $this->empresas[] = $empresa;
  165.             $empresa->setConvenio($this);
  166.         }
  167.         return $this;
  168.     }
  169.     public function removeEmpresa(Empresa $empresa): self
  170.     {
  171.         if ($this->empresas->contains($empresa)) {
  172.             $this->empresas->removeElement($empresa);
  173.             // set the owning side to null (unless already changed)
  174.             if ($empresa->getConvenio() === $this) {
  175.                 $empresa->setConvenio(null);
  176.             }
  177.         }
  178.         return $this;
  179.     }
  180. }