<?phpnamespace App\Entity;use App\Repository\RateRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;/** * @ORM\Entity(repositoryClass=RateRepository::class) */class Rate{ /** * @ORM\Id() * @ORM\GeneratedValue() * @ORM\Column(type="integer") */ private $id; /** * @ORM\Column(type="string", length=40) */ private $content; /** * @ORM\Column(type="float") */ private $price; /** * @ORM\OneToMany(targetEntity=Product::class, mappedBy="rate") */ private $products; /** * @ORM\Column(type="float", nullable=true) */ private $tax; /** * @ORM\Column(type="string", length=255, nullable=true) */ private $abrev; public function __construct() { $this->products = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function getContent(): ?string { return $this->content; } public function setContent(string $content): self { $this->content = $content; return $this; } public function getPrice(): ?float { return $this->price; } public function setPrice(float $price): self { $this->price = $price; return $this; } /** * @return Collection|Product[] */ public function getProducts(): Collection { return $this->products; } public function addProduct(Product $product): self { if (!$this->products->contains($product)) { $this->products[] = $product; $product->setRate($this); } return $this; } public function removeProduct(Product $product): self { if ($this->products->contains($product)) { $this->products->removeElement($product); // set the owning side to null (unless already changed) if ($product->getRate() === $this) { $product->setRate(null); } } return $this; } public function __toString() { return $this->content; } public function getTax(): ?float { return $this->tax; } public function setTax(?float $tax): self { $this->tax = $tax; return $this; } public function getAbrev(): ?string { return $this->abrev; } public function setAbrev(?string $abrev): self { $this->abrev = $abrev; return $this; }}