src/Entity/ProductBalanceInStorage.php line 30

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use ApiPlatform\Metadata\ApiResource;
  4. use App\Repository\ProductBalanceInStorageRepository;
  5. use Doctrine\DBAL\Types\Types;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Symfony\Component\Serializer\Annotation\Groups;
  8. use ApiPlatform\Metadata\ApiFilter;
  9. use ApiPlatform\Doctrine\Orm\Filter\SearchFilter;
  10. #[ORM\Entity(repositoryClassProductBalanceInStorageRepository::class)]
  11. #[ApiResource(
  12.     normalizationContext: ['groups' => ['product_storage_balance:read']],
  13.     denormalizationContext: ['groups' => ['product_storage_balance:write']],
  14.     order: ['manager' => 'DESC'],
  15. )]
  16. #[ApiFilter(
  17.     SearchFilter::class, 
  18.     properties: [
  19.         'storage.id' => 'exact',
  20.         'product.id' => 'exact'
  21.         'manager.id' => 'exact'
  22.     ],
  23. )]
  24. class ProductBalanceInStorage
  25. {
  26.     #[Groups(['product_storage_balance:read''product_storage_balance:write''product:read''order_product:read'])]
  27.     #[ORM\Id]
  28.     #[ORM\GeneratedValue]
  29.     #[ORM\Column
  30.     private ?int $id null;
  31.     #[Groups(['product_storage_balance:read''product_storage_balance:write''product:read''order_product:read'])]
  32.     #[ORM\Column(typeTypes::DATETIME_MUTABLEnullabletrue)]
  33.     private ?\DateTimeInterface $date_entered null;
  34.     #[Groups(['product_storage_balance:read''product_storage_balance:write''product:read''order_product:read'])]
  35.     #[ORM\Column(typeTypes::DATETIME_MUTABLEnullabletrue)]
  36.     private ?\DateTimeInterface $date_modified null;
  37.     #[Groups(['product_storage_balance:read''product_storage_balance:write''product:read''order_product:read'])]
  38.     #[ORM\ManyToOne(inversedBy'productBalanceInStorages')]
  39.     #[ORM\JoinColumn(nullablefalse)]
  40.     private ?Products $product null;
  41.     #[Groups(['product_storage_balance:read''product_storage_balance:write''product:read''order_product:read'])]
  42.     #[ORM\ManyToOne(inversedBy'productBalanceInStorages')]
  43.     #[ORM\JoinColumn(nullablefalse)]
  44.     private ?Storage $storage null;
  45.     #[Groups(['product_storage_balance:read''product_storage_balance:write''product:read''order_product:read'])]
  46.     #[ORM\Column(nullabletrue)]
  47.     private ?float $count null;
  48.     #[Groups(['product_storage_balance:read''product_storage_balance:write''product:read''order_product:read'])]
  49.     #[ORM\ManyToOne(inversedBy'productBalanceInStorages')]
  50.     private ?User $manager null;
  51.     #[Groups(['product_storage_balance:read''product_storage_balance:write''product:read''order_product:read'])]
  52.     #[ORM\Column(length100nullabletrue)]
  53.     private ?string $code1c null;
  54.     public function getId(): ?int
  55.     {
  56.         return $this->id;
  57.     }
  58.     public function getDateEntered(): ?\DateTimeInterface
  59.     {
  60.         return $this->date_entered;
  61.     }
  62.     public function setDateEntered(?\DateTimeInterface $date_entered): self
  63.     {
  64.         $this->date_entered $date_entered;
  65.         return $this;
  66.     }
  67.     public function getDateModified(): ?\DateTimeInterface
  68.     {
  69.         return $this->date_modified;
  70.     }
  71.     public function setDateModified(?\DateTimeInterface $date_modified): self
  72.     {
  73.         $this->date_modified $date_modified;
  74.         return $this;
  75.     }
  76.     public function getProduct(): ?Products
  77.     {
  78.         return $this->product;
  79.     }
  80.     public function setProduct(?Products $product): self
  81.     {
  82.         $this->product $product;
  83.         return $this;
  84.     }
  85.     public function getStorage(): ?Storage
  86.     {
  87.         return $this->storage;
  88.     }
  89.     public function setStorage(?Storage $storage): self
  90.     {
  91.         $this->storage $storage;
  92.         return $this;
  93.     }
  94.     public function getCount(): ?float
  95.     {
  96.         return $this->count;
  97.     }
  98.     public function setCount(?float $count): self
  99.     {
  100.         $this->count $count;
  101.         return $this;
  102.     }
  103.     public function getManager(): ?User
  104.     {
  105.         return $this->manager;
  106.     }
  107.     public function setManager(?User $manager): self
  108.     {
  109.         $this->manager $manager;
  110.         return $this;
  111.     }
  112.     public function getCode1c(): ?string
  113.     {
  114.         return $this->code1c;
  115.     }
  116.     public function setCode1c(?string $code1c): self
  117.     {
  118.         $this->code1c $code1c;
  119.         return $this;
  120.     }
  121. }