src/Entity/TypeUser.php line 19

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use ApiPlatform\Core\Annotation\ApiResource;
  4. use App\Repository\TypeUserRepository;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use Symfony\Component\Serializer\Annotation\Groups;
  7. #[ORM\Entity(repositoryClassTypeUserRepository::class)]
  8. #[ApiResource(
  9.     collectionOperations:[
  10.         'get'
  11.     ],
  12.     itemOperations: [
  13.         'get'
  14.     ],
  15. )]
  16. class TypeUser
  17. {
  18.     #[ORM\Id]
  19.     #[ORM\GeneratedValue]
  20.     #[ORM\Column(type'integer')]
  21.     #[Groups(['user:read'])]
  22.     private $id;
  23.     #[ORM\Column(type'string'length45)]
  24.     #[Groups(['user:read'])]
  25.     private $label;
  26.     #[ORM\Column(type'integer'nullabletrue)]
  27.     private $code;
  28.     public function __construct()
  29.     {
  30.     }
  31.     public function getId(): ?int
  32.     {
  33.         return $this->id;
  34.     }
  35.     public function getLabel(): ?string
  36.     {
  37.         return $this->label;
  38.     }
  39.     public function setLabel(string $label): self
  40.     {
  41.         $this->label $label;
  42.         return $this;
  43.     }
  44.     public function getCode(): ?int
  45.     {
  46.         return $this->code;
  47.     }
  48.     public function setCode(?int $code): self
  49.     {
  50.         $this->code $code;
  51.         return $this;
  52.     }
  53. }