<?phpnamespace App\Entity;use App\Repository\TipoTarifaRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;/** * @ORM\Entity(repositoryClass=TipoTarifaRepository::class) */class TipoTarifa{ /** * @ORM\Id() * @ORM\GeneratedValue() * @ORM\Column(type="integer") */ private $id; /** * @ORM\Column(type="string", length=255) */ private $nombre; /** * @ORM\OneToMany(targetEntity=Tarifa::class, mappedBy="tipoTarifa") */ private $tarifas; /** * @ORM\OneToMany(targetEntity=TipoImpuesto::class, mappedBy="tipoTarifa") */ private $tipoImpuestos; /** * @ORM\OneToMany(targetEntity=TipoIva::class, mappedBy="tipoTarifa") */ private $tipoIvas; public function __construct() { $this->tarifas = new ArrayCollection(); $this->facturas = new ArrayCollection(); $this->tipoImpuestos = new ArrayCollection(); $this->tipoIvas = 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; } /** * @return Collection|Tarifa[] */ public function getTarifas(): Collection { return $this->tarifas; } public function addTarifa(Tarifa $tarifa): self { if (!$this->tarifas->contains($tarifa)) { $this->tarifas[] = $tarifa; $tarifa->setTipoTarifa($this); } return $this; } public function removeTarifa(Tarifa $tarifa): self { if ($this->tarifas->contains($tarifa)) { $this->tarifas->removeElement($tarifa); // set the owning side to null (unless already changed) if ($tarifa->getTipoTarifa() === $this) { $tarifa->setTipoTarifa(null); } } return $this; } public function __toString(): string { return $this->nombre; } /** * @return Collection<int, TipoImpuesto> */ public function getTipoImpuestos(): Collection { return $this->tipoImpuestos; } public function addTipoImpuesto(TipoImpuesto $tipoImpuesto): self { if (!$this->tipoImpuestos->contains($tipoImpuesto)) { $this->tipoImpuestos[] = $tipoImpuesto; $tipoImpuesto->setTipoTarifa($this); } return $this; } public function removeTipoImpuesto(TipoImpuesto $tipoImpuesto): self { if ($this->tipoImpuestos->removeElement($tipoImpuesto)) { // set the owning side to null (unless already changed) if ($tipoImpuesto->getTipoTarifa() === $this) { $tipoImpuesto->setTipoTarifa(null); } } return $this; } /** * @return Collection<int, TipoIva> */ public function getTipoIvas(): Collection { return $this->tipoIvas; } public function addTipoIva(TipoIva $tipoIva): self { if (!$this->tipoIvas->contains($tipoIva)) { $this->tipoIvas[] = $tipoIva; $tipoIva->setTipoTarifa($this); } return $this; } public function removeTipoIva(TipoIva $tipoIva): self { if ($this->tipoIvas->removeElement($tipoIva)) { // set the owning side to null (unless already changed) if ($tipoIva->getTipoTarifa() === $this) { $tipoIva->setTipoTarifa(null); } } return $this; }}