src/Entity/BlogGpv.php line 24

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use ApiPlatform\Metadata\ApiResource;
  4. use App\Repository\BlogGpvRepository;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use ApiPlatform\Metadata\Get;
  7. use ApiPlatform\Metadata\GetCollection;
  8. use Symfony\Component\Serializer\Annotation\Groups;
  9. use ApiPlatform\Metadata\ApiFilter;
  10. use ApiPlatform\Doctrine\Orm\Filter\SearchFilter;
  11. #[ORM\Entity(repositoryClassBlogGpvRepository::class)]
  12. #[ApiResource(
  13.     normalizationContext: ['groups' => ['read']],
  14.     denormalizationContext: ['groups' => ['write']],
  15. )]
  16. #[Get]
  17. #[GetCollection]
  18. #[ApiFilter(SearchFilter::class, properties: ['city' => 'partial''street' => 'partial''building' => 'partial'])]
  19. class BlogGpv
  20. {
  21.     #[ORM\Id]
  22.     #[ORM\GeneratedValue]
  23.     #[ORM\Column]
  24.     #[Groups(['read'])]
  25.     private ?int $id null;
  26.     #[Groups(['read'])]
  27.     #[ORM\Column(length45nullabletrue)]
  28.     private ?string $city null;
  29.     #[Groups(['read'])]
  30.     #[ORM\Column(length255nullabletrue)]
  31.     private ?string $street null;
  32.     #[Groups(['read'])]
  33.     #[ORM\Column(length45nullabletrue)]
  34.     private ?string $building null;
  35.     #[ORM\Column(length45nullabletrue)]
  36.     private ?string $apartment null;
  37.     #[Groups(['read'])]
  38.     #[ORM\Column(length45nullabletrue)]
  39.     private ?string $group_type null;
  40.     #[ORM\Column(length15nullabletrue)]
  41.     private ?string $code null;
  42.     #[ORM\Column(length45nullabletrue)]
  43.     private ?string $rem_tech null;
  44.     #[Groups(['read'])]
  45.     #[ORM\Column(nullabletrue)]
  46.     private ?int $id_tree null;
  47.     public function getId(): ?int
  48.     {
  49.         return $this->id;
  50.     }
  51.     public function getCity(): ?string
  52.     {
  53.         return $this->city;
  54.     }
  55.     public function setCity(?string $city): self
  56.     {
  57.         $this->city $city;
  58.         return $this;
  59.     }
  60.     public function getStreet(): ?string
  61.     {
  62.         return $this->street;
  63.     }
  64.     public function setStreet(?string $street): self
  65.     {
  66.         $this->street $street;
  67.         return $this;
  68.     }
  69.     public function getBuilding(): ?string
  70.     {
  71.         return $this->building;
  72.     }
  73.     public function setBuilding(?string $building): self
  74.     {
  75.         $this->building $building;
  76.         return $this;
  77.     }
  78.     public function getApartment(): ?string
  79.     {
  80.         return $this->apartment;
  81.     }
  82.     public function setApartment(?string $apartment): self
  83.     {
  84.         $this->apartment $apartment;
  85.         return $this;
  86.     }
  87.     public function getGroupType(): ?string
  88.     {
  89.         return $this->group_type;
  90.     }
  91.     public function setGroupType(?string $group_type): self
  92.     {
  93.         $this->group_type $group_type;
  94.         return $this;
  95.     }
  96.     public function getCode(): ?string
  97.     {
  98.         return $this->code;
  99.     }
  100.     public function setCode(?string $code): self
  101.     {
  102.         $this->code $code;
  103.         return $this;
  104.     }
  105.     public function getRemTech(): ?string
  106.     {
  107.         return $this->rem_tech;
  108.     }
  109.     public function setRemTech(?string $rem_tech): self
  110.     {
  111.         $this->rem_tech $rem_tech;
  112.         return $this;
  113.     }
  114.     public function getIdTree(): ?int
  115.     {
  116.         return $this->id_tree;
  117.     }
  118.     public function setIdTree(?int $id_tree): self
  119.     {
  120.         $this->id_tree $id_tree;
  121.         return $this;
  122.     }
  123. }