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''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.  
  52.     #[Groups(['product_storage_balance:read''product_storage_balance:write''product:read''order_product:read'])]
  53.     #[ORM\Column(length100nullabletrue)]
  54.     private ?string $code1c null;
  55.     public function getId(): ?int
  56.     {
  57.         return $this->id;
  58.     }
  59.     public function getDateEntered(): ?\DateTimeInterface
  60.     {
  61.         return $this->date_entered;
  62.     }
  63.     public function setDateEntered(?\DateTimeInterface $date_entered): self
  64.     {
  65.         $this->date_entered $date_entered;
  66.         return $this;
  67.     }
  68.     public function getDateModified(): ?\DateTimeInterface
  69.     {
  70.         return $this->date_modified;
  71.     }
  72.     public function setDateModified(?\DateTimeInterface $date_modified): self
  73.     {
  74.         $this->date_modified $date_modified;
  75.         return $this;
  76.     }
  77.     public function getProduct(): ?Products
  78.     {
  79.         return $this->product;
  80.     }
  81.     public function setProduct(?Products $product): self
  82.     {
  83.         $this->product $product;
  84.         return $this;
  85.     }
  86.     public function getStorage(): ?Storage
  87.     {
  88.         return $this->storage;
  89.     }
  90.     public function setStorage(?Storage $storage): self
  91.     {
  92.         $this->storage $storage;
  93.         return $this;
  94.     }
  95.     public function getCount(): ?float
  96.     {
  97.         return $this->count;
  98.     }
  99.     public function setCount(?float $count): self
  100.     {
  101.         $this->count $count;
  102.         return $this;
  103.     }
  104.     public function getManager(): ?User
  105.     {
  106.         return $this->manager;
  107.     }
  108.     public function setManager(?User $manager): self
  109.     {
  110.         $this->manager $manager;
  111.         return $this;
  112.     }
  113.     public function getCode1c(): ?string
  114.     {
  115.         return $this->code1c;
  116.     }
  117.     public function setCode1c(?string $code1c): self
  118.     {
  119.         $this->code1c $code1c;
  120.         return $this;
  121.     }
  122. }