src/Entity/Tax.php line 9

  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\TaxRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. #[ORM\Entity(repositoryClass: TaxRepository::class)]
  6. class Tax
  7. {
  8.     #[ORM\Id]
  9.     #[ORM\GeneratedValue]
  10.     #[ORM\Column]
  11.     private ?int $id = null;
  12.     #[ORM\Column]
  13.     private ?float $value = null;
  14.     public function __toString(): string
  15.     {
  16.         $tax = $this->value * 100;
  17.         return "$tax %";
  18.     }
  19.     public function getId(): ?int
  20.     {
  21.         return $this->id;
  22.     }
  23.     public function getValue(): ?float
  24.     {
  25.         return $this->value;
  26.     }
  27.     public function setValue(float $value): static
  28.     {
  29.         $this->value = $value;
  30.         return $this;
  31.     }
  32. }