src/Entity/SpNpWarehouses.php line 23

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use ApiPlatform\Metadata\ApiResource;
  4. use App\Repository\SpNpWarehousesRepository;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use Symfony\Component\Serializer\Annotation\Groups;
  7. use ApiPlatform\Metadata\ApiFilter;
  8. use ApiPlatform\Doctrine\Orm\Filter\SearchFilter;
  9. #[ORM\Entity(repositoryClassSpNpWarehousesRepository::class)]
  10. #[ApiResource(
  11.     normalizationContext: ['groups' => ['sp_np:read']],
  12.     denormalizationContext: ['groups' => ['sp_np:write']],
  13.     order: ['id' => 'DESC']
  14. )]
  15. #[ApiFilter(SearchFilter::class, properties: [
  16.     'CityRef' => 'exact'
  17.     'siteKey' => 'exact'
  18.     'name' => 'partial' 
  19. ])]
  20. class SpNpWarehouses
  21. {
  22.     #[Groups(['sp_np:read''sp_np:write''sp:read'])]
  23.     #[ORM\Id]
  24.     #[ORM\GeneratedValue]
  25.     #[ORM\Column]
  26.     private ?int $id null;
  27.     #[Groups(['sp_np:read''sp_np:write''sp:read'])]
  28.     #[ORM\Column(length255nullabletrue)]
  29.     private ?string $name null;
  30.     #[Groups(['sp_np:read''sp_np:write''sp:read'])]
  31.     #[ORM\Column(nullabletrue)]
  32.     private ?int $siteKey null;
  33.     #[Groups(['sp_np:read''sp_np:write''sp:read'])]
  34.     #[ORM\Column(length255nullabletrue)]
  35.     private ?string $address null;
  36.     #[Groups(['sp_np:read''sp_np:write''sp:read'])]
  37.     #[ORM\Column(nullabletrue)]
  38.     private ?array $object null;
  39.     #[Groups(['sp_np:read''sp_np:write''sp:read'])]
  40.     #[ORM\Column(length50nullabletrue)]
  41.     private ?string $CityRef null;
  42.     public function getId(): ?int
  43.     {
  44.         return $this->id;
  45.     }
  46.     public function getName(): ?string
  47.     {
  48.         return $this->name;
  49.     }
  50.     public function setName(?string $name): static
  51.     {
  52.         $this->name $name;
  53.         return $this;
  54.     }
  55.     public function getSiteKey(): ?int
  56.     {
  57.         return $this->siteKey;
  58.     }
  59.     public function setSiteKey(?int $siteKey): static
  60.     {
  61.         $this->siteKey $siteKey;
  62.         return $this;
  63.     }
  64.     public function getAddress(): ?string
  65.     {
  66.         return $this->address;
  67.     }
  68.     public function setAddress(?string $address): static
  69.     {
  70.         $this->address $address;
  71.         return $this;
  72.     }
  73.     public function getObject(): ?array
  74.     {
  75.         return $this->object;
  76.     }
  77.     public function setObject(?array $object): static
  78.     {
  79.         $this->object $object;
  80.         return $this;
  81.     }
  82.     public function getCityRef(): ?string
  83.     {
  84.         return $this->CityRef;
  85.     }
  86.     public function setCityRef(?string $CityRef): static
  87.     {
  88.         $this->CityRef $CityRef;
  89.         return $this;
  90.     }
  91. }