src/Point/Doctrine/Entity/PaymentMethod.php line 23

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace App\Point\Doctrine\Entity;
  4. use ApiPlatform\Core\Annotation\ApiResource;
  5. use App\Point\Doctrine\Repository\PaymentMethodRepository;
  6. use Doctrine\ORM\Mapping\Column;
  7. use Doctrine\ORM\Mapping\Entity;
  8. use Doctrine\ORM\Mapping\GeneratedValue;
  9. use Doctrine\ORM\Mapping\Id;
  10. use Doctrine\ORM\Mapping\Table;
  11. use Symfony\Component\Serializer\Annotation\Groups;
  12. #[ApiResource(
  13.     collectionOperations: ['get'],
  14.     itemOperations: ['get'],
  15.     normalizationContext: ['groups' => ['read']]
  16. )]
  17. #[Entity(PaymentMethodRepository::class)]
  18. #[Table(name'`point_payment_method`')]
  19. class PaymentMethod
  20. {
  21.     #[Id]
  22.     #[Column(type'integer')]
  23.     #[GeneratedValue]
  24.     #[Groups('read')]
  25.     private ?int $id null;
  26.     #[Column(uniquetrue)]
  27.     #[Groups('read')]
  28.     private string $code;
  29.     #[Column]
  30.     #[Groups('read')]
  31.     private string $name;
  32.     public function getId(): ?int
  33.     {
  34.         return $this->id;
  35.     }
  36.     public function getCode(): string
  37.     {
  38.         return $this->code;
  39.     }
  40.     public function setCode(string $code): void
  41.     {
  42.         $this->code $code;
  43.     }
  44.     public function getName(): string
  45.     {
  46.         return $this->name;
  47.     }
  48.     public function setName(string $name): void
  49.     {
  50.         $this->name $name;
  51.     }
  52. }