src/Entity/Products.php line 103

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use ApiPlatform\Metadata\ApiResource;
  4. use App\Repository\ProductsRepository;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Collections\Collection;
  7. use Doctrine\DBAL\Types\Types;
  8. use Doctrine\ORM\Mapping as ORM;
  9. use Symfony\Component\Security\Core\Security;
  10. use Symfony\Component\Security\Core\SecurityInterface;
  11. use DateTimeImmutable;
  12. use ApiPlatform\Metadata\ApiFilter;
  13. use ApiPlatform\Doctrine\Orm\Filter\SearchFilter;
  14. use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\BooleanFilter;
  15. use ApiPlatform\Metadata\Get;
  16. use ApiPlatform\Metadata\GetCollection;
  17. use ApiPlatform\Metadata\Delete;
  18. use ApiPlatform\Metadata\Put;
  19. use ApiPlatform\Metadata\Post;
  20. use App\Controller\BatchCreateProductAction;
  21. use App\Controller\ProductController;
  22. use Symfony\Component\Serializer\Annotation\Groups;
  23. use ApiPlatform\Core\Annotation\ApiProperty
  24. use Symfony\Component\Serializer\Annotation\MaxDepth;
  25. use App\Filter\ShowProductsFilter;
  26. use ApiPlatform\Doctrine\Orm\Filter\OrderFilter;
  27. use ApiPlatform\Doctrine\Orm\Filter\RangeFilter;
  28. use App\Filter\CustomOrFilter
  29. #[ORM\Entity(repositoryClassProductsRepository::class)]
  30. #[ApiResource(
  31.     operations: [
  32.         new Get(),
  33.         new Post(),
  34.         new Delete(),
  35.         new GetCollection(),
  36.         new Put(),
  37.         new Post(
  38.             name'batch'
  39.             uriTemplate'/products/batch'
  40.             controllerBatchCreateProductAction::class
  41.         ),
  42.         new Get(
  43.             name'filter_product'
  44.             uriTemplate'/products/filter'
  45.             controllerProductController::class
  46.         )
  47.     ],
  48.     normalizationContext: ['groups' => ['product:read']],
  49.     denormalizationContext: ['groups' => ['product:write']],
  50.     order: ['id' => 'DESC'],
  51.     // paginationPartial: true,
  52.     paginationEnabledtrue,
  53.     // filters: [ShowProductsFilter::class] 
  54. )]
  55. // #[Get]
  56. #[ORM\HasLifecycleCallbacks]
  57. #[ApiFilter(RangeFilter::class, properties: ['balance'])]
  58. #[ApiFilter(CustomOrFilter::class,properties: [
  59.     'name' => 'ipartial'
  60.     'barcode' => 'exact'
  61.     'article' => 'exact',
  62.     'code1c' => 'exact',
  63. ])]
  64. #[ApiFilter(
  65.     SearchFilter::class, 
  66.     properties: [
  67.         'oldCode' => 'exact'
  68.         // 'code1c' => 'exact', 
  69.         'top' => 'exact'
  70.         'productToOrder' => 'exact'
  71.         'name' => 'ipartial'
  72.         // 'barcode' => 'exact', 
  73.         'category.id' => 'exact',
  74.         'attributeItems.id' => 'exact',
  75.         'show' => 'exact',
  76.         // 'article' => 'exact',
  77.         'prices.product' => 'exact',
  78.         'prices.agreement.virtual' => 'exact',
  79.         'prices.agreement.account.id' => 'exact',
  80.         'productBalanceInStorages.manager.id' => 'exact',
  81.         'orderProducts.order.account.id' => 'exact',
  82.         'orderProducts.order.account.user.id' => 'exact',
  83.     ],
  84. )]
  85. #[ApiFilter(OrderFilter::class, properties: ['price''name'], arguments: ['orderParameterName' => 'order'])]
  86. // #[ApiFilter(ShowProductsFilter::class)]
  87. // #[ApiFilter(ShowProductsFilter::class)]
  88. class Products
  89. {
  90.     #[ORM\Id]
  91.     #[ORM\GeneratedValue]
  92.     #[ORM\Column]
  93.     #[Groups(['product:read''product:write''cat:read''order:read''order_product:read''pre_order_product:read''pre_order:read''load_invoice:read''user_like:read''order_product:read''attributes_items:read''attributes:read',  'cat:read','product_storage_balance:read'])]
  94.     private ?int $id null;
  95.     #[ORM\Column(length255)]
  96.     #[Groups(['product:read''product:write''cat:read''order:read''order_product:read''pre_order_product:read''pre_order:read''load_invoice:read''user_like:read''order_product:read''attributes_items:read''attributes:read',  'cat:read','product_storage_balance:read'])]
  97.     private ?string $name null;
  98.     #[ORM\Column(typeTypes::DATETIME_MUTABLE)]
  99.     #[Groups(['product:read'])]
  100.     private ?\DateTimeInterface $date_entered;
  101.     #[ORM\Column(typeTypes::DATETIME_MUTABLEnullabletrue)]
  102.     #[Groups(['product:read'])]
  103.     private ?\DateTimeInterface $date_modified;
  104.     #[ORM\ManyToOne(inversedBy'products')]
  105.     #[Groups(['product:read'])]
  106.     #[MaxDepth(1)]
  107.     private ?User $modified_user null;
  108.     #[ORM\ManyToOne(inversedBy'create_products')]
  109.     #[Groups(['product:read'])]
  110.     #[MaxDepth(1)]
  111.     private ?User $created_by;
  112.     #[Groups(['product:read''product:write'])]
  113.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  114.     private ?string $description null;
  115.     #[ORM\Column(length20nullabletrue)]
  116.     #[Groups(['product:read''product:write''order:read''order_product:read''pre_order_product:read''pre_order:read''load_invoice:read''order_product:read''product_storage_balance:read'])]
  117.     private ?string $code1c null;
  118.     #[ORM\Column(length100nullabletrue)]
  119.     #[Groups(['product:read''product:write''cat:read''order:read''order_product:read''pre_order_product:read''pre_order:read''load_invoice:read''user_like:read''order_product:read''product_storage_balance:read'])]
  120.     private ?string $barcode null;
  121.     #[ORM\Column(length100nullabletrue)]
  122.     #[Groups(['product:read''product:write'])]
  123.     private ?string $status null;
  124.     #[ORM\Column(nullabletrue)]
  125.     #[Groups(['product:read''product:write''order_product:read''cat:read''order:read''order_product:read''pre_order_product:read''pre_order:read''load_invoice:read''user_like:read''attributes_items:read''attributes:read',  'cat:read','product_storage_balance:read'])]
  126.     private ?float $price null;
  127.     #[ORM\Column(nullabletrue)]
  128.     #[Groups(['product:read''product:write''order_product:read'])]
  129.     private ?float $priceIncome null;
  130.     #[ORM\Column(nullabletrue)]
  131.     #[Groups(['product:read''product:write'])]
  132.     private ?float $mark_up null;
  133.     #[ORM\Column]
  134.     #[Groups(['product:read''product:write'])]
  135.     private ?float $min_mark_up 1;
  136.     #[ORM\Column(length100nullabletrue)]
  137.     #[Groups(['product:read''product:write'])]
  138.     private ?string $packing_type null;
  139.     #[ORM\Column(nullabletrue)]
  140.     #[Groups(['product:read''product:write'])]
  141.     private ?float $packing_type_count null;
  142.     #[ORM\Column(nullabletrue)]
  143.     #[Groups(['product:read''product:write''order_product:read'])]
  144.     private ?int $discounts null;
  145.     #[ORM\Column]
  146.     #[Groups(['product:read','cat:read''product:write'])]
  147.     private ?int $top 0;
  148.     #[ORM\Column(nullabletrue)]
  149.     #[Groups(['product:read''product:write'])]
  150.     private ?int $count_order null;
  151.     #[ORM\Column(nullabletrue)]
  152.     #[Groups(['product:read''product:write'])]
  153.     private ?int $productToOrder null;
  154.     #[ORM\ManyToOne]
  155.     #[Groups(['product:read''product:write''cat:read''load_invoice:read''pre_order_product:read''pre_order:read''order:read''order_product:read''order_product:read''product_storage_balance:read'])]
  156.     #[ApiProperty(writabletrue)]
  157.     #[MaxDepth(1)]
  158.     private ?MeasurmentUnit $measurement_unit null;
  159.     #[Groups(['product:read''product:write'])]
  160.     #[MaxDepth(1)]
  161.     #[ORM\OneToMany(mappedBy'product'targetEntityProductInfo::class,)]
  162.     private ?Collection $productInfos null;
  163.     #[MaxDepth(1)]
  164.     #[Groups(['product:read''product:write''cat:read''user_like:read''pre_order_product:read''pre_order:read''order:read''order_product:read''order_product:read'])]
  165.     #[ORM\OneToMany(mappedBy'product'targetEntityMediaObject::class)]
  166.     private Collection $media;
  167.     #[MaxDepth(2)]
  168.     #[Groups(['product:read''product:write'])]
  169.     #[ORM\OneToMany(mappedBy'product'targetEntityIncomingInvoiceProduct::class)]
  170.     private Collection $incomingInvoiceProducts;
  171.     
  172.     private ?SecurityInterface $security null;
  173.     #[ORM\Column(length20nullabletrue)]
  174.     #[Groups(['product:read''product:write''cat:read''load_invoice:read''pre_order_product:read''pre_order:read''order:read''order_product:read''order_product:read''product_storage_balance:read'])]
  175.     private ?string $article null;
  176.     #[ORM\Column(nullabletrue)]
  177.     #[Groups(['product:read''product:write'])]
  178.     private ?float $nds null;
  179.     #[ORM\Column(nullabletrue)]
  180.     #[Groups(['product:read''product:write'])]
  181.     private ?bool $service null;
  182.     #[ORM\Column(nullabletrue)]
  183.     #[Groups(['product:read''product:write'])]
  184.     private ?bool $transport_service null;
  185.     #[ORM\Column(nullabletrue)]
  186.     #[Groups(['product:read''product:write'])]
  187.     private ?bool $exise false;
  188.     #[ORM\Column(nullabletrue)]
  189.     #[Groups(['product:read''product:write'])]
  190.     private ?bool $expiration_date null;
  191.     #[ORM\Column(nullabletrue)]
  192.     #[Groups(['product:read''product:write'])]
  193.     private ?float $unit_volume null;
  194.     #[ORM\Column(nullabletrue)]
  195.     #[Groups(['product:read''product:write'])]
  196.     private ?float $net_weight null;
  197.     #[ORM\Column(nullabletrue)]
  198.     #[Groups(['product:read''product:write'])]
  199.     private ?float $gross_weight null;
  200.     #[ORM\Column(nullabletrue)]
  201.     #[Groups(['product:read''product:write'])]
  202.     private ?bool $go_by_weight null;
  203.     #[ORM\Column(nullabletrue)]
  204.     #[Groups(['product:read''product:write'])]
  205.     private ?float $packaging null;
  206.     #[ORM\ManyToOne(inversedBy'products')]
  207.     #[MaxDepth(2)]
  208.     #[Groups(['product:read''product:write'])]
  209.     private ?SiteProducts $site_product null;
  210.     #[Groups(['product:read''product:write',  'attributes:read'])]
  211.     #[ORM\ManyToMany(targetEntityCategory::class, inversedBy'products')]
  212.     #[MaxDepth(1)]
  213.     private Collection $category;
  214.     #[ORM\OneToMany(mappedBy'product'targetEntityMediaObject::class)]
  215.     private Collection $mediaObjects;
  216.     #[Groups(['product:read''product:write'])]
  217.     #[ORM\Column(length100nullabletrue)]
  218.     private ?string $oldCode null;
  219.     #[ORM\OneToMany(mappedBy'product'targetEntityUserLikeList::class)]
  220.     private Collection $userLikeLists;
  221.     #[Groups(['product:read''product:write'])]
  222.     #[ORM\ManyToMany(targetEntityAttributeItems::class, mappedBy'product')] 
  223.     private Collection $attributeItems;
  224.     #[Groups(['product:read''product:write''cat:read''load_invoice:read''pre_order_product:read''pre_order:read''order:read''order_product:read''order_product:read'])]
  225.     #[ORM\Column(nullabletrue)]
  226.     private ?bool $show null;
  227.     #[Groups(['product:read''product:write''cat:read''load_invoice:read''pre_order_product:read''pre_order:read''order:read''order_product:read''order_product:read'])]
  228.     #[ORM\ManyToOne(inversedBy'products')]
  229.     private ?Storage $storage null;
  230.     #[MaxDepth(2)]
  231.     #[Groups(['product:read''product:write','order:read''order_product:read'])]
  232.     #[ORM\ManyToOne(inversedBy'products')]
  233.     private ?StorageElement $storageElement null;
  234.     #[ORM\OneToMany(mappedBy'product'targetEntityPrices::class)]
  235.     private Collection $prices;
  236.     #[Groups(['product:read''product:write''order_product:read''pre_order_product:read'])]
  237.     #[ORM\OneToMany(mappedBy'product'targetEntityProductBalanceInStorage::class)]
  238.     private Collection $productBalanceInStorages;
  239.     #[Groups(['product:read''product:write''cat:read''order:read''order_product:read''pre_order_product:read''pre_order:read''load_invoice:read''user_like:read''order_product:read''attributes_items:read''attributes:read',  'cat:read',])]
  240.     #[ORM\Column(nullabletrue)]
  241.     private ?float $balance null;
  242.     #[ApiProperty(writabletrue)]
  243.     #[ORM\OneToMany(mappedBy'product'targetEntityOrderProduct::class)]
  244.     private Collection $orderProducts;
  245.     #[Groups(['product:read''product:write'])]
  246.     #[ORM\ManyToOne(inversedBy'products')]
  247.     private ?Languages $language null;
  248.     #[Groups(['product:read''product:write'])]
  249.     #[ORM\ManyToOne(targetEntityself::class, inversedBy'products')]
  250.     private ?self $translations null;
  251.     #[ORM\OneToMany(mappedBy'translations'targetEntityself::class)]
  252.     private Collection $products;
  253.     public function __construct() {
  254.         $this->productInfos = new ArrayCollection();
  255.         $this->media = new ArrayCollection();
  256.         $this->incomingInvoiceProducts = new ArrayCollection();
  257.         $this->category = new ArrayCollection();
  258.         $this->mediaObjects = new ArrayCollection();
  259.         $this->userLikeLists = new ArrayCollection();
  260.         $this->attributeItems = new ArrayCollection();
  261.         $this->prices = new ArrayCollection();
  262.         $this->productBalanceInStorages = new ArrayCollection();
  263.         $this->orderProducts = new ArrayCollection();
  264.         $this->products = new ArrayCollection();
  265.     }
  266.     public function getId(): ?int
  267.     {
  268.         return $this->id;
  269.     }
  270.     public function setId(string $id): self
  271.     {
  272.         $this->id $id;
  273.         return $this;
  274.     }
  275.     public function getName(): ?string
  276.     {
  277.         return $this->name;
  278.     }
  279.     public function setName(string $name): self
  280.     {
  281.         $this->name $name;
  282.         return $this;
  283.     }
  284.     public function getDateEntered(): ?\DateTimeInterface
  285.     {
  286.         return $this->date_entered;
  287.     }
  288.     // public function setDateEntered(?\DateTimeInterface $date_entered): self
  289.     // {
  290.     //     $this->date_entered = $date_entered;
  291.     //     return $this;
  292.     // }
  293.     public function getDateModified(): ?\DateTimeInterface
  294.     {
  295.         return $this->date_modified;
  296.     }
  297.     // public function setDateModified(?\DateTimeInterface $date_modified): self
  298.     // {
  299.     //     $this->date_modified = $date_modified;
  300.     //     return $this;
  301.     // }
  302.     public function getModifiedUser(): ?User
  303.     {
  304.         return $this->modified_user;
  305.     }
  306.     // public function setModifiedUserId(?User $modified_user_id): self
  307.     // {
  308.     //     $this->modified_user_id = $modified_user_id;
  309.     //     return $this;
  310.     // }
  311.     public function getCreatedBy(): ?User
  312.     {
  313.         return $this->created_by;
  314.     }
  315.     public function setCreatedBy(?User $created_by): self
  316.     {
  317.         $this->created_by $created_by;
  318.         return $this;
  319.     }
  320.     public function getDescription(): ?string
  321.     {
  322.         return $this->description;
  323.     }
  324.     public function setDescription(?string $description): self
  325.     {
  326.         $this->description $description;
  327.         return $this;
  328.     }
  329.     public function getCode1c(): ?string
  330.     {
  331.         return $this->code1c;
  332.     }
  333.     public function setCode1c(?string $code1c): self
  334.     {
  335.         $this->code1c $code1c;
  336.         return $this;
  337.     }
  338.     public function getBarcode(): ?string
  339.     {
  340.         return $this->barcode;
  341.     }
  342.     public function setBarcode(?string $barcode): self
  343.     {
  344.         $this->barcode $barcode;
  345.         return $this;
  346.     }
  347.     public function getStatus(): ?string
  348.     {
  349.         return $this->status;
  350.     }
  351.     public function setStatus(?string $status): self
  352.     {
  353.         $this->status $status;
  354.         return $this;
  355.     }
  356.     public function getPrice(): ?float
  357.     {
  358.         return $this->price;
  359.     }
  360.     public function setPrice(?float $price): self
  361.     {
  362.         $this->price $price;
  363.         return $this;
  364.     }
  365.     public function getPriceIncome(): ?float
  366.     {
  367.         return $this->priceIncome;
  368.     }
  369.     public function setPriceIncome(?float $priceIncome): self
  370.     {
  371.         $this->priceIncome $priceIncome;
  372.         return $this;
  373.     }
  374.     public function getMarkUp(): ?float
  375.     {
  376.         return $this->mark_up;
  377.     }
  378.     public function setMarkUp(?float $mark_up): self
  379.     {
  380.         $this->mark_up $mark_up;
  381.         return $this;
  382.     }
  383.     public function getMinMarkUp(): ?float
  384.     {
  385.         return $this->min_mark_up;
  386.     }
  387.     public function setMinMarkUp(float $min_mark_up): self
  388.     {
  389.         $this->min_mark_up $min_mark_up;
  390.         return $this;
  391.     }
  392.     public function getPackingType(): ?string
  393.     {
  394.         return $this->packing_type;
  395.     }
  396.     public function setPackingType(?string $packing_type): self
  397.     {
  398.         $this->packing_type $packing_type;
  399.         return $this;
  400.     }
  401.     public function getPackingTypeCount(): ?float
  402.     {
  403.         return $this->packing_type_count;
  404.     }
  405.     public function setPackingTypeCount(?float $packing_type_count): self
  406.     {
  407.         $this->packing_type_count $packing_type_count;
  408.         return $this;
  409.     }
  410.     public function getDiscounts(): ?int
  411.     {
  412.         return $this->discounts;
  413.     }
  414.     public function setDiscounts(?int $discounts): self
  415.     {
  416.         $this->discounts $discounts;
  417.         return $this;
  418.     }
  419.     public function getTop(): ?int
  420.     {
  421.         return $this->top;
  422.     }
  423.     public function setTop(int $top): self
  424.     {
  425.         $this->top $top;
  426.         return $this;
  427.     }
  428.     public function getCountOrder(): ?int
  429.     {
  430.         return $this->count_order;
  431.     }
  432.     public function setCountOrder(?int $count_order): self
  433.     {
  434.         $this->count_order $count_order;
  435.         return $this;
  436.     }
  437.     public function getProductToOrder(): ?int
  438.     {
  439.         return $this->productToOrder;
  440.     }
  441.     public function setProductToOrder(?int $productToOrder): self
  442.     {
  443.         $this->productToOrder $productToOrder;
  444.         return $this;
  445.     }
  446.     public function getMeasurementUnit(): ?MeasurmentUnit
  447.     {
  448.         return $this->measurement_unit;
  449.     }
  450.     public function setMeasurementUnit(?MeasurmentUnit $measurement_unit_id): self
  451.     {
  452.         $this->measurement_unit $measurement_unit_id;
  453.         return $this;
  454.     }
  455.     /**
  456.      * @return Collection<int, ProductInfo>
  457.      */
  458.     public function getProductInfos(): Collection
  459.     {
  460.         return $this->productInfos;
  461.     }
  462.     public function addProductInfo(ProductInfo $productInfo): self
  463.     {
  464.         if (!$this->productInfos->contains($productInfo)) {
  465.             $this->productInfos->add($productInfo);
  466.             $productInfo->setProduct($this);
  467.         }
  468.         return $this;
  469.     }
  470.     public function removeProductInfo(ProductInfo $productInfo): self
  471.     {
  472.         if ($this->productInfos->removeElement($productInfo)) {
  473.             // set the owning side to null (unless already changed)
  474.             if ($productInfo->getProduct() === $this) {
  475.                 $productInfo->setProduct(null);
  476.             }
  477.         }
  478.         return $this;
  479.     }
  480.     /**
  481.      * @return Collection<int, MediaObject>
  482.      */
  483.     public function getMedia(): Collection
  484.     {
  485.         return $this->media;
  486.     }
  487.     public function addMedium(MediaObject $medium): self
  488.     {
  489.         if (!$this->media->contains($medium)) {
  490.             $this->media->add($medium);
  491.             $medium->setProduct($this);
  492.         }
  493.         return $this;
  494.     }
  495.     public function removeMedium(MediaObject $medium): self
  496.     {
  497.         if ($this->media->removeElement($medium)) {
  498.             // set the owning side to null (unless already changed)
  499.             if ($medium->getProduct() === $this) {
  500.                 $medium->setProduct(null);
  501.             }
  502.         }
  503.         return $this;
  504.     }
  505.     /**
  506.      * @return Collection<int, IncomingInvoiceProduct>
  507.      */
  508.     public function getIncomingInvoiceProducts(): Collection
  509.     {
  510.         return $this->incomingInvoiceProducts;
  511.     }
  512.     public function addIncomingInvoiceProduct(IncomingInvoiceProduct $incomingInvoiceProduct): self
  513.     {
  514.         if (!$this->incomingInvoiceProducts->contains($incomingInvoiceProduct)) {
  515.             $this->incomingInvoiceProducts->add($incomingInvoiceProduct);
  516.             $incomingInvoiceProduct->setProduct($this);
  517.         }
  518.         return $this;
  519.     }
  520.     public function removeIncomingInvoiceProduct(IncomingInvoiceProduct $incomingInvoiceProduct): self
  521.     {
  522.         if ($this->incomingInvoiceProducts->removeElement($incomingInvoiceProduct)) {
  523.             // set the owning side to null (unless already changed)
  524.             if ($incomingInvoiceProduct->getProduct() === $this) {
  525.                 $incomingInvoiceProduct->setProduct(null);
  526.             }
  527.         }
  528.         return $this;
  529.     }
  530.     #[ORM\PrePersist]
  531.     public function setCreatedAtValue(): void
  532.     {
  533.         $this->date_entered = new \DateTime();
  534.         file_put_contents('/var/www/symfony_docker/public/errorrrrrr.log'$this->getCurrentUserId() . "\n"FILE_APPEND);
  535.         $this->created_by $this->getCurrentUserId();
  536.     }
  537.     // #[ORM\PrePersist]
  538.     #[ORM\PreUpdate]
  539.     public function setUpdatedAtValue(): void
  540.     {
  541.         file_put_contents('/var/www/symfony_docker/public/errorrrrrr.log'"222222\n"FILE_APPEND);
  542.         $this->date_modified = new \DateTime();
  543.         $this->modified_user $this->getCurrentUserId();
  544.     }
  545.     public function getCurrentUserId(): ?User
  546.     {
  547.         file_put_contents('/var/www/symfony_docker/public/errorrrrrr.log'print_r($this->securitytrue)."\n"FILE_APPEND);
  548.         if (!$this->security) {
  549.             return null;
  550.         }
  551.         $token $this->security->getToken();
  552.         if (!$token) {
  553.             return null;
  554.         }
  555.         $user $token->getUser();
  556.         if (!$user instanceof User) {
  557.             return null;
  558.         }
  559.         return $user;
  560.     }
  561.     public function __sleep()
  562.     {
  563.         return [
  564.             'modified_user',
  565.             // 'created_by',
  566.             // 'date_entered',
  567.             'date_modified'
  568.         ];
  569.     }
  570.     public function __wakeup(): void
  571.     {
  572.         $this->security null;
  573.     }
  574.     public function getArticle(): ?string
  575.     {
  576.         return $this->article;
  577.     }
  578.     public function setArticle(?string $article): self
  579.     {
  580.         $this->article $article;
  581.         return $this;
  582.     }
  583.     public function getNds(): ?float
  584.     {
  585.         return $this->nds;
  586.     }
  587.     public function setNds(?float $nds): self
  588.     {
  589.         $this->nds $nds;
  590.         return $this;
  591.     }
  592.     public function isService(): ?bool
  593.     {
  594.         return $this->service;
  595.     }
  596.     public function setService(?bool $service): self
  597.     {
  598.         $this->service $service;
  599.         return $this;
  600.     }
  601.     public function isTransportService(): ?bool
  602.     {
  603.         return $this->transport_service;
  604.     }
  605.     public function setTransportService(?bool $transport_service): self
  606.     {
  607.         $this->transport_service $transport_service;
  608.         return $this;
  609.     }
  610.     public function isExise(): ?bool
  611.     {
  612.         return $this->exise;
  613.     }
  614.     public function setExise(bool $exise): self
  615.     {
  616.         $this->exise $exise;
  617.         return $this;
  618.     }
  619.     public function isExpirationDate(): ?bool
  620.     {
  621.         return $this->expiration_date;
  622.     }
  623.     public function setExpirationDate(?bool $expiration_date): self
  624.     {
  625.         $this->expiration_date $expiration_date;
  626.         return $this;
  627.     }
  628.     public function getUnitVolume(): ?float
  629.     {
  630.         return $this->unit_volume;
  631.     }
  632.     public function setUnitVolume(?float $unit_volume): self
  633.     {
  634.         $this->unit_volume $unit_volume;
  635.         return $this;
  636.     }
  637.     public function getNetWeight(): ?float
  638.     {
  639.         return $this->net_weight;
  640.     }
  641.     public function setNetWeight(?float $net_weight): self
  642.     {
  643.         $this->net_weight $net_weight;
  644.         return $this;
  645.     }
  646.     public function getGrossWeight(): ?float
  647.     {
  648.         return $this->gross_weight;
  649.     }
  650.     public function setGrossWeight(?float $gross_weight): self
  651.     {
  652.         $this->gross_weight $gross_weight;
  653.         return $this;
  654.     }
  655.     public function isGoByWeight(): ?bool
  656.     {
  657.         return $this->go_by_weight;
  658.     }
  659.     public function setGoByWeight(?bool $go_by_weight): self
  660.     {
  661.         $this->go_by_weight $go_by_weight;
  662.         return $this;
  663.     }
  664.     public function getPackaging(): ?float
  665.     {
  666.         return $this->packaging;
  667.     }
  668.     public function setPackaging(?float $packaging): self
  669.     {
  670.         $this->packaging $packaging;
  671.         return $this;
  672.     }
  673.     public function getSiteProduct(): ?SiteProducts
  674.     {
  675.         return $this->site_product;
  676.     }
  677.     public function setSiteProduct(?SiteProducts $site_product): self
  678.     {
  679.         $this->site_product $site_product;
  680.         return $this;
  681.     }
  682.     /**
  683.      * @return Collection<int, Category>
  684.      */
  685.     public function getCategory(): Collection
  686.     {
  687.         return $this->category;
  688.     }
  689.     public function addCategory(Category $category): self
  690.     {
  691.         if (!$this->category->contains($category)) {
  692.             $this->category->add($category);
  693.         }
  694.         return $this;
  695.     }
  696.     public function removeCategory(Category $category): self
  697.     {
  698.         $this->category->removeElement($category);
  699.         return $this;
  700.     }
  701.     /**
  702.      * @return Collection<int, MediaObject>
  703.      */
  704.     public function getMediaObjects(): Collection
  705.     {
  706.         return $this->mediaObjects;
  707.     }
  708.     public function addMediaObject(MediaObject $mediaObject): self
  709.     {
  710.         if (!$this->mediaObjects->contains($mediaObject)) {
  711.             $this->mediaObjects->add($mediaObject);
  712.             $mediaObject->setProduct($this);
  713.         }
  714.         return $this;
  715.     }
  716.     public function removeMediaObject(MediaObject $mediaObject): self
  717.     {
  718.         if ($this->mediaObjects->removeElement($mediaObject)) {
  719.             // set the owning side to null (unless already changed)
  720.             if ($mediaObject->getProduct() === $this) {
  721.                 $mediaObject->setProduct(null);
  722.             }
  723.         }
  724.         return $this;
  725.     }
  726.     public function getOldCode(): ?string
  727.     {
  728.         return $this->oldCode;
  729.     }
  730.     public function setOldCode(string $oldCode): self
  731.     {
  732.         $this->oldCode $oldCode;
  733.         return $this;
  734.     }
  735.     /**
  736.      * @return Collection<int, UserLikeList>
  737.      */
  738.     public function getUserLikeLists(): Collection
  739.     {
  740.         return $this->userLikeLists;
  741.     }
  742.     public function addUserLikeList(UserLikeList $userLikeList): self
  743.     {
  744.         if (!$this->userLikeLists->contains($userLikeList)) {
  745.             $this->userLikeLists->add($userLikeList);
  746.             $userLikeList->setз�product($this);
  747.         }
  748.         return $this;
  749.     }
  750.     public function removeUserLikeList(UserLikeList $userLikeList): self
  751.     {
  752.         if ($this->userLikeLists->removeElement($userLikeList)) {
  753.             // set the owning side to null (unless already changed)
  754.             if ($userLikeList->getз�product() === $this) {
  755.                 $userLikeList->setз�product(null);
  756.             }
  757.         }
  758.         return $this;
  759.     }
  760.     /**
  761.      * @return Collection<int, AttributeItems>
  762.      */
  763.     public function getAttributeItems(): Collection
  764.     {
  765.         return $this->attributeItems;
  766.     }
  767.     public function addAttributeItem(AttributeItems $attributeItem): self
  768.     {
  769.         if (!$this->attributeItems->contains($attributeItem)) {
  770.             $this->attributeItems->add($attributeItem);
  771.             $attributeItem->addProduct($this);
  772.         }
  773.         return $this;
  774.     }
  775.     public function removeAttributeItem(AttributeItems $attributeItem): self
  776.     {
  777.         if ($this->attributeItems->removeElement($attributeItem)) {
  778.             $attributeItem->removeProduct($this);
  779.         }
  780.         return $this;
  781.     }
  782.     public function isShow(): ?bool
  783.     {
  784.         return $this->show;
  785.     }
  786.     public function setShow(?bool $show): self
  787.     {
  788.         $this->show $show;
  789.         return $this;
  790.     }
  791.     public function getStorage(): ?Storage
  792.     {
  793.         return $this->storage;
  794.     }
  795.     public function setStorage(?Storage $storage): self
  796.     {
  797.         $this->storage $storage;
  798.         return $this;
  799.     }
  800.     public function getStorageElement(): ?StorageElement
  801.     {
  802.         return $this->storageElement;
  803.     }
  804.     public function setStorageElement(?StorageElement $storageElement): self
  805.     {
  806.         $this->storageElement $storageElement;
  807.         return $this;
  808.     }
  809.     
  810.     /**
  811.      * @return Collection<int, Prices>
  812.      */
  813.     public function getPrices(): Collection
  814.     {
  815.         return $this->prices;
  816.     }
  817.     public function addPrice(Prices $price): static
  818.     {
  819.         if (!$this->prices->contains($price)) {
  820.             $this->prices->add($price);
  821.             $price->setAgreement($this);
  822.         }
  823.         return $this;
  824.     }
  825.     public function removePrice(Prices $price): static
  826.     {
  827.         if ($this->prices->removeElement($price)) {
  828.             // set the owning side to null (unless already changed)
  829.             if ($price->getAgreement() === $this) {
  830.                 $price->setAgreement(null);
  831.             }
  832.         }
  833.         return $this;
  834.     }
  835.     /**
  836.      * @return Collection<int, ProductBalanceInStorage>
  837.      */
  838.     public function getProductBalanceInStorages(): Collection
  839.     {
  840.         return $this->productBalanceInStorages;
  841.     }
  842.     public function addProductBalanceInStorage(ProductBalanceInStorage $productBalanceInStorage): self
  843.     {
  844.         if (!$this->productBalanceInStorages->contains($productBalanceInStorage)) {
  845.             $this->productBalanceInStorages->add($productBalanceInStorage);
  846.             $productBalanceInStorage->setProduct($this);
  847.         }
  848.         return $this;
  849.     }
  850.     public function removeProductBalanceInStorage(ProductBalanceInStorage $productBalanceInStorage): self
  851.     {
  852.         if ($this->productBalanceInStorages->removeElement($productBalanceInStorage)) {
  853.             // set the owning side to null (unless already changed)
  854.             if ($productBalanceInStorage->getProduct() === $this) {
  855.                 $productBalanceInStorage->setProduct(null);
  856.             }
  857.         }
  858.         return $this;
  859.     }
  860.     public function getBalance(): ?float
  861.     {
  862.         return $this->balance;
  863.     }
  864.     public function setBalance(?float $balance): self
  865.     {
  866.         $this->balance $balance;
  867.         return $this;
  868.     }
  869.     /**
  870.      * @return Collection<int, OrderProduct>
  871.      */
  872.     public function getOrderProducts(): Collection
  873.     {
  874.         return $this->orderProducts;
  875.     }
  876.     public function addOrderProduct(OrderProduct $orderProduct): self
  877.     {
  878.         if (!$this->orderProducts->contains($orderProduct)) {
  879.             $this->orderProducts->add($orderProduct);
  880.             $orderProduct->setOrder($this);
  881.         }
  882.         return $this;
  883.     }
  884.     public function removeOrderProduct(OrderProduct $orderProduct): self
  885.     {
  886.         if ($this->orderProducts->removeElement($orderProduct)) {
  887.             // set the owning side to null (unless already changed)
  888.             if ($orderProduct->getOrder() === $this) {
  889.                 $orderProduct->setOrder(null);
  890.             }
  891.         }
  892.         return $this;
  893.     }
  894.     public function getLanguage(): ?Languages
  895.     {
  896.         return $this->language;
  897.     }
  898.     public function setLanguage(?Languages $language): self
  899.     {
  900.         $this->language $language;
  901.         return $this;
  902.     }
  903.     public function getTranslations(): ?self
  904.     {
  905.         return $this->translations;
  906.     }
  907.     public function setTranslations(?self $translations): self
  908.     {
  909.         $this->translations $translations;
  910.         return $this;
  911.     }
  912.     /**
  913.      * @return Collection<int, self>
  914.      */
  915.     public function getProducts(): Collection
  916.     {
  917.         return $this->products;
  918.     }
  919.     public function addProduct(self $product): self
  920.     {
  921.         if (!$this->products->contains($product)) {
  922.             $this->products->add($product);
  923.             $product->setTranslations($this);
  924.         }
  925.         return $this;
  926.     }
  927.     public function removeProduct(self $product): self
  928.     {
  929.         if ($this->products->removeElement($product)) {
  930.             // set the owning side to null (unless already changed)
  931.             if ($product->getTranslations() === $this) {
  932.                 $product->setTranslations(null);
  933.             }
  934.         }
  935.         return $this;
  936.     }
  937. }