<?php
namespace App\Entity;
use App\Repository\ConvenioRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=ConvenioRepository::class)
*/
class Convenio
{
/**
* @ORM\Id()
* @ORM\GeneratedValue()
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=100)
*/
private $nombre;
/**
* @ORM\Column(type="boolean")
*/
private $estado;
/**
* @ORM\Column(type="datetime")
*/
private $created_at;
/**
* @ORM\Column(type="datetime")
*/
private $updated_at;
/**
* @ORM\OneToMany(targetEntity=ItemConvenios::class, mappedBy="convenio")
*/
private $itemConvenios;
/**
* @ORM\OneToMany(targetEntity=PlanoDetalle::class, mappedBy="convenio")
*/
private $planoDetalles;
/**
* @ORM\OneToMany(targetEntity=Empresa::class, mappedBy="convenio")
*/
private $empresas;
public function __construct()
{
$this->itemConvenios = new ArrayCollection();
$this->planoDetalles = new ArrayCollection();
$this->empresas = 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 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;
}
/**
* Generates the magic method
*
*/
public function __toString(){
// to show the name of the Category in the select
return $this->nombre;
// to show the id of the Category in the select
// return $this->id;
}
/**
* @return Collection|ItemConvenios[]
*/
public function getItemConvenios(): Collection
{
return $this->itemConvenios;
}
public function addItemConvenio(ItemConvenios $itemConvenio): self
{
if (!$this->itemConvenios->contains($itemConvenio)) {
$this->itemConvenios[] = $itemConvenio;
$itemConvenio->setConvenio($this);
}
return $this;
}
public function removeItemConvenio(ItemConvenios $itemConvenio): self
{
if ($this->itemConvenios->contains($itemConvenio)) {
$this->itemConvenios->removeElement($itemConvenio);
// set the owning side to null (unless already changed)
if ($itemConvenio->getConvenio() === $this) {
$itemConvenio->setConvenio(null);
}
}
return $this;
}
/**
* @return Collection|PlanoDetalle[]
*/
public function getPlanoDetalles(): Collection
{
return $this->planoDetalles;
}
public function addPlanoDetalle(PlanoDetalle $planoDetalle): self
{
if (!$this->planoDetalles->contains($planoDetalle)) {
$this->planoDetalles[] = $planoDetalle;
$planoDetalle->setConvenio($this);
}
return $this;
}
public function removePlanoDetalle(PlanoDetalle $planoDetalle): self
{
if ($this->planoDetalles->contains($planoDetalle)) {
$this->planoDetalles->removeElement($planoDetalle);
// set the owning side to null (unless already changed)
if ($planoDetalle->getConvenio() === $this) {
$planoDetalle->setConvenio(null);
}
}
return $this;
}
/**
* @return Collection|Empresa[]
*/
public function getEmpresas(): Collection
{
return $this->empresas;
}
public function addEmpresa(Empresa $empresa): self
{
if (!$this->empresas->contains($empresa)) {
$this->empresas[] = $empresa;
$empresa->setConvenio($this);
}
return $this;
}
public function removeEmpresa(Empresa $empresa): self
{
if ($this->empresas->contains($empresa)) {
$this->empresas->removeElement($empresa);
// set the owning side to null (unless already changed)
if ($empresa->getConvenio() === $this) {
$empresa->setConvenio(null);
}
}
return $this;
}
}