<?phpnamespace App\Entity;use App\Repository\ImpuestoRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;/** * @ORM\Entity(repositoryClass=ImpuestoRepository::class) */class Impuesto{ /** * @ORM\Id() * @ORM\GeneratedValue() * @ORM\Column(type="integer") */ private $id; /** * @ORM\Column(type="string", length=255) */ private $nombre; /** * @ORM\Column(type="decimal", precision=13, scale=10) */ private $importe; /** * @ORM\Column(type="date", nullable=true) */ private $fecha; /** * @ORM\OneToMany(targetEntity=TipoImpuesto::class, mappedBy="impuesto") */ private $tipoImpuestos; /** * @ORM\OneToMany(targetEntity=TipoIva::class, mappedBy="impuesto") */ private $tipoIvas; public function __construct() { $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; } public function getImporte(): ?string { return $this->importe; } public function setImporte(string $importe): self { $this->importe = $importe; return $this; } public function getFecha(): ?\DateTimeInterface { return $this->fecha; } public function setFecha(?\DateTimeInterface $fecha): self { $this->fecha = $fecha; return $this; } /** * @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->setImpuesto($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->getImpuesto() === $this) { $tipoImpuesto->setImpuesto(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->setImpuesto($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->getImpuesto() === $this) { $tipoIva->setImpuesto(null); } } return $this; }}