<?phpnamespace App\Entity;use App\Repository\ProductRepository;use Doctrine\ORM\Mapping as ORM;/** * @ORM\Entity(repositoryClass=ProductRepository::class) */class Product{ /** * @ORM\Id * @ORM\GeneratedValue * @ORM\Column(type="integer") */ private $id; /** * @ORM\Column(type="string", length=255) */ private $name; /** * @ORM\Column(type="string", length=255) */ private $slug; /** * @ORM\Column(type="string", length=255) */ private $description; /** * @ORM\Column(type="string", length=255) */ private $illustration; /** * @ORM\Column(type="float") */ private $price; /** * @ORM\Column(type="float") */ private $tva; /** * @ORM\ManyToOne(targetEntity=Category::class, inversedBy="products") */ private $category; /** * @ORM\Column(type="boolean", nullable=true) */ private $isHomepage; // Getters & Setters public function getId(): ?int { return $this->id; } public function getName(): ?string { return $this->name; } public function setName(string $name): self { $this->name = $name; return $this; } public function getSlug(): ?string { return $this->slug; } public function setSlug(string $slug): self { $this->slug = $slug; return $this; } public function getDescription(): ?string { return $this->description; } public function setDescription(string $description): self { $this->description = $description; return $this; } public function getIllustration(): ?string { return $this->illustration; } public function setIllustration(string $illustration): self { $this->illustration = $illustration; return $this; } public function getPrice(): ?float { return $this->price; } public function setPrice(float $price): self { $this->price = $price; return $this; } public function getPriceWt(): ?float { $coeff = 1 + ($this->tva/100); return $coeff * $this->price; } public function getTva(): ?float { return $this->tva; } public function setTva(float $tva): self { $this->tva = $tva; return $this; } public function getCategory(): ?Category { return $this->category; } public function setCategory(?Category $category): self { $this->category = $category; return $this; } public function isIsHomepage(): ?bool { return $this->isHomepage; } public function setIsHomepage(?bool $isHomepage): self { $this->isHomepage = $isHomepage; return $this; }}