src/Shop/Doctrine/Entity/Vat.php line 18

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace App\Shop\Doctrine\Entity;
  4. use App\Shop\Doctrine\Repository\VatRepository;
  5. use Doctrine\ORM\Mapping\Column;
  6. use Doctrine\ORM\Mapping\Entity;
  7. use Doctrine\ORM\Mapping\GeneratedValue;
  8. use Doctrine\ORM\Mapping\Id;
  9. use Doctrine\ORM\Mapping\Table;
  10. use Symfony\Component\PropertyAccess\PropertyAccess;
  11. use Symfony\Component\Validator\Constraints\NotBlank;
  12. #[Entity(repositoryClassVatRepository::class)]
  13. #[Table(name'`shop_vat`')]
  14. class Vat
  15. {
  16.     #[Id]
  17.     #[Column(type'integer')]
  18.     #[GeneratedValue]
  19.     private ?int $id null;
  20.     #[Column]
  21.     #[NotBlank]
  22.     private string $name;
  23.     #[Column(type'float'precision5scale4)]
  24.     #[NotBlank]
  25.     private float $rate;
  26.     public function __get(string $name): mixed
  27.     {
  28.         $propertyAccessor PropertyAccess::createPropertyAccessor();
  29.         return $propertyAccessor->getValue($this$name);
  30.     }
  31.     public function getId(): ?int
  32.     {
  33.         return $this->id;
  34.     }
  35.     public function getName(): string
  36.     {
  37.         return $this->name;
  38.     }
  39.     public function setName(string $name): void
  40.     {
  41.         $this->name $name;
  42.     }
  43.     public function getRate(): float
  44.     {
  45.         return $this->rate;
  46.     }
  47.     public function setRate(float $rate): void
  48.     {
  49.         $this->rate $rate;
  50.     }
  51. }