src/Entity/Option.php line 11

  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\OptionRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Symfony\Component\Serializer\Annotation\Groups;
  6. #[ORM\Entity(repositoryClassOptionRepository::class)]
  7. #[ORM\Table(name'`option`')]
  8. class Option
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column]
  13.     #[Groups(['article:view'])]
  14.     private ?int $id null;
  15.     #[ORM\Column(length255)]
  16.     #[Groups(['article:view''article:new'])]
  17.     private ?string $name null;
  18.     #[ORM\Column(length255)]
  19.     #[Groups(['article:view''article:new'])]
  20.     private ?string $value null;
  21.     #[ORM\Column(nullabletrue)]
  22.     #[Groups(['article:view''article:new'])]
  23.     private ?float $price null;
  24.     public function getId(): ?int
  25.     {
  26.         return $this->id;
  27.     }
  28.     public function getName(): ?string
  29.     {
  30.         return $this->name;
  31.     }
  32.     public function setName(string $name): self
  33.     {
  34.         $this->name $name;
  35.         return $this;
  36.     }
  37.     public function getValue(): ?string
  38.     {
  39.         return $this->value;
  40.     }
  41.     public function setValue(string $value): self
  42.     {
  43.         $this->value $value;
  44.         return $this;
  45.     }
  46.     public function getPrice(): ?float
  47.     {
  48.         return $this->price;
  49.     }
  50.     public function setPrice(?float $price): self
  51.     {
  52.         $this->price $price;
  53.         return $this;
  54.     }
  55.     public function __toString(): string
  56.     {
  57.         return $this->name;
  58.     }
  59. }