<?phpnamespace App\Entity;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;use Symfony\Component\Serializer\Annotation\Groups;/** * @ORM\Entity(repositoryClass="App\Repository\TaxRepository") */class Tax{ /** * @ORM\Id() * @ORM\GeneratedValue() * @ORM\Column(type="integer") * @Groups("Tax") */ private $id; /** * @ORM\Column(type="decimal", precision=5, scale=2) * @Groups("Tax") */ private $amountTax; /** * @ORM\OneToMany(targetEntity=PackageCompagny::class, mappedBy="tax") */ private $packageCompagnies; /** * @ORM\OneToMany(targetEntity=Refund::class, mappedBy="tva") */ private $refunds; public function __construct() { $this->packageCompagnies = new ArrayCollection(); $this->refunds = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function getAmountTax(): ?string { return $this->amountTax; } public function setAmountTax(string $amountTax): self { $this->amountTax = $amountTax; return $this; } /** * @return Collection|PackageCompagny[] */ public function getPackageCompagnies(): Collection { return $this->packageCompagnies; } public function addPackageCompagny(PackageCompagny $packageCompagny): self { if (!$this->packageCompagnies->contains($packageCompagny)) { $this->packageCompagnies[] = $packageCompagny; $packageCompagny->setTax($this); } return $this; } public function removePackageCompagny(PackageCompagny $packageCompagny): self { if ($this->packageCompagnies->contains($packageCompagny)) { $this->packageCompagnies->removeElement($packageCompagny); // set the owning side to null (unless already changed) if ($packageCompagny->getTax() === $this) { $packageCompagny->setTax(null); } } return $this; } public function __toString(){ return $this->amountTax; } /** * @return Collection|Refund[] */ public function getRefunds(): Collection { return $this->refunds; } public function addRefund(Refund $refund): self { if (!$this->refunds->contains($refund)) { $this->refunds[] = $refund; $refund->setTva($this); } return $this; } public function removeRefund(Refund $refund): self { if ($this->refunds->removeElement($refund)) { // set the owning side to null (unless already changed) if ($refund->getTva() === $this) { $refund->setTva(null); } } return $this; }}