src/Entity/Products.php line 106

  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. use App\Filter\AttributeFilter
  30. use App\Filter\DeletedFilter
  31. use Doctrine\ORM\Mapping\Index;
  32. use ApiPlatform\Serializer\Filter\GroupFilter;
  33. use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\ExistsFilter;
  34. #[ORM\Entity(repositoryClassProductsRepository::class)]
  35. #[ApiResource(
  36.     operations: [
  37.         new Get(),
  38.         new Post(),
  39.         new Delete(),
  40.         new GetCollection(),
  41.         new Put(),
  42.         new Post(
  43.             name'batch'
  44.             uriTemplate'/products/batch'
  45.             controllerBatchCreateProductAction::class
  46.         ),
  47.         new Get(
  48.             name'filter_product'
  49.             uriTemplate'/products/filter'
  50.             controllerProductController::class
  51.         )
  52.     ],
  53.     normalizationContext: ['groups' => ['product:read''prod:medium']],
  54.     denormalizationContext: ['groups' => ['product:write']],
  55.     order: ['name' => 'ASC''media.sort' => 'DESC''discontinued' => 'DESC'],
  56.     // paginationPartial: true,
  57.     // paginationEnabled: true,
  58.     // filters: [ShowProductsFilter::class] 
  59. )]
  60. // #[Get]
  61. #[ORM\HasLifecycleCallbacks]
  62. #[ApiFilter(RangeFilter::class, properties: ['balance''price'])]
  63. #[ApiFilter(DeletedFilter::class)]
  64. #[ApiFilter(
  65.     SearchFilter::class, 
  66.     properties: [
  67.         'id' => 'exact'
  68.         'oldCode' => 'exact'
  69.         'code1c' => 'exact'
  70.         'top' => 'exact'
  71.         'productToOrder' => 'exact'
  72.         'name' => 'ipartial'
  73.         'barcode' => 'exact'
  74.         'category.id' => 'exact',
  75.         'category.slug' => 'exact',
  76.         'category.type' => 'exact',
  77.         'attributeItems.id' => 'exact',
  78.         'show' => 'exact',
  79.         'article' => 'exact',
  80.         'prices.product' => 'exact',
  81.         'prices.agreement.virtual' => 'exact',
  82.         'prices.agreement.account.id' => 'exact',
  83.         'productBalanceInStorages.manager.id' => 'exact',
  84.         'orderProducts.order.account.id' => 'exact',
  85.         'orderProducts.order.account.user.id' => 'exact',
  86.         'categoryCnt' => 'exact',
  87.         'deleted' => 'exact',
  88.         'isSalle' => 'exact',
  89.         'isNew' => 'exact',
  90.         'isTop' => 'exact',
  91.         'category.slug' => 'exact',
  92.         'translation' => 'exact',
  93.         'language' => 'exact',
  94.         'discontinued' => 'exact',
  95.     ],
  96. )]
  97. #[ApiFilter(AttributeFilter::class)]
  98. #[ApiFilter(OrderFilter::class, properties: ['price''name'], arguments: ['orderParameterName' => 'order'])]
  99. #[Index(name"show"columns: ["show""deleted"])]
  100. #[ApiFilter(GroupFilter::class, arguments: ['parameterName' => 'g''overrideDefaultGroups' => true])]
  101. #[ApiFilter(ExistsFilter::class, properties: ['attributeItems'])]
  102. class Products
  103. {
  104.     #[ORM\Id]
  105.     #[ORM\GeneratedValue]
  106.     #[ORM\Column]
  107.     #[Groups(['product:read''product:admin''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',   'cat:read','product_storage_balance:read''site_product:read''product_releted:read'])]
  108.     private ?int $id null;
  109.     #[ORM\Column(length255)]
  110.     #[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',   'cat:read','product_storage_balance:read''site_product:read''product_releted:read'])]
  111.     private ?string $name null;
  112.     #[ORM\Column(typeTypes::DATETIME_MUTABLE)]
  113.     #[Groups(['product:admin'])]
  114.     private ?\DateTimeInterface $date_entered;
  115.     #[ORM\Column(typeTypes::DATETIME_MUTABLEnullabletrue)]
  116.     #[Groups(['product:admin'])]
  117.     private ?\DateTimeInterface $date_modified;
  118.     #[ORM\ManyToOne(inversedBy'products')]
  119.     #[Groups(['product:modified_user'])]
  120.     #[MaxDepth(1)]
  121.     private ?User $modified_user null;
  122.     #[ORM\ManyToOne(inversedBy'create_products')]
  123.     #[Groups(['product:created_by'])]
  124.     #[MaxDepth(1)]
  125.     private ?User $created_by;
  126.     #[Groups(['product:read''product:write''site_product:read'])]
  127.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  128.     private ?string $description null;
  129.     #[ORM\Column(length20nullabletrue)]
  130.     #[Groups([ 'product:admin''product:write''order:read''order_product:read''pre_order_product:read''pre_order:read''load_invoice:read''order_product:read''product_storage_balance:read''site_product:read'])]
  131.     private ?string $code1c null;
  132.     #[ORM\Column(length100nullabletrue)]
  133.     #[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''site_product:read''product_releted:read'])]
  134.     private ?string $barcode null;
  135.     #[ORM\Column(length100nullabletrue)]
  136.     #[Groups(['product:read''product:write'])]
  137.     private ?string $status null;
  138.     #[ORM\Column(nullabletrue)]
  139.     #[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',   'cat:read','product_storage_balance:read''site_product:read''product_releted:read'])]
  140.     private ?float $price null;
  141.     #[ORM\Column(nullabletrue)]
  142.     #[Groups([ 'product:admin''product:write''order_product:read''product_releted:read'])]
  143.     private ?float $priceIncome null;
  144.     #[ORM\Column(nullabletrue)]
  145.     #[Groups(['product:admin''product:write'])]
  146.     private ?float $mark_up null;
  147.     #[ORM\Column]
  148.     #[Groups(['product:admin''product:write'])]
  149.     private ?float $min_mark_up 1;
  150.     #[ORM\Column(length100nullabletrue)]
  151.     #[Groups(['product:write'])]
  152.     private ?string $packing_type null;
  153.     #[ORM\Column(nullabletrue)]
  154.     #[Groups(['product:write'])]
  155.     private ?float $packing_type_count null;
  156.     #[ORM\Column(nullabletrue)]
  157.     #[Groups(['product:read''product:write''order_product:read''product_releted:read'])]
  158.     private ?int $discounts null;
  159.     #[ORM\Column(nullabletrue)]
  160.     #[Groups(['product:admin''product:write'])]
  161.     private ?int $count_order null;
  162.     #[ORM\Column(nullabletrue)]
  163.     #[Groups(['product:read''product:write'])]
  164.     private ?int $productToOrder null;
  165.     #[ORM\ManyToOne]
  166.     #[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''site_product:read'])]
  167.     #[ApiProperty(writabletrue)]
  168.     #[MaxDepth(1)]
  169.     private ?MeasurmentUnit $measurement_unit null;
  170.     #[Groups(['product:productInfos''product:write''site_product:read'])]
  171.     #[MaxDepth(1)]
  172.     #[ORM\OneToMany(mappedBy'product'targetEntityProductInfo::class,)]
  173.     private ?Collection $productInfos null;
  174.     #[MaxDepth(1)]
  175.     #[Groups(['product:media''product:write''cat:read''user_like:read''pre_order_product:read''pre_order:read''order:read''order_product:read''order_product:read''site_product:read'])]
  176.     #[ORM\OneToMany(mappedBy'product'targetEntityMediaObject::class)]
  177.     private Collection $media;
  178.     #[MaxDepth(2)]
  179.     #[Groups(['product:incomingInvoiceProducts''product:write'])]
  180.     #[ORM\OneToMany(mappedBy'product'targetEntityIncomingInvoiceProduct::class)]
  181.     private Collection $incomingInvoiceProducts;
  182.     
  183.     private ?SecurityInterface $security null;
  184.     #[ORM\Column(length20nullabletrue)]
  185.     #[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''site_product:read''product_releted:read'])]
  186.     private ?string $article null;
  187.     #[ORM\Column(nullabletrue)]
  188.     #[Groups(['product:admin''product:write'])]
  189.     private ?float $nds null;
  190.     #[ORM\Column(nullabletrue)]
  191.     #[Groups(['product:admin''product:write'])]
  192.     private ?bool $service null;
  193.     #[ORM\Column(nullabletrue)]
  194.     #[Groups(['product:admin''product:write'])]
  195.     private ?bool $transport_service null;
  196.     #[ORM\Column(nullabletrue)]
  197.     #[Groups(['product:read''product:write'])]
  198.     private ?bool $exise false;
  199.     #[ORM\Column(nullabletrue)]
  200.     #[Groups(['product:read''product:write'])]
  201.     private ?bool $expiration_date null;
  202.     #[ORM\Column(nullabletrue)]
  203.     #[Groups(['product:read''product:write'])]
  204.     private ?float $unit_volume null;
  205.     #[ORM\Column(nullabletrue)]
  206.     #[Groups(['product:read''product:write'])]
  207.     private ?float $net_weight null;
  208.     #[ORM\Column(nullabletrue)]
  209.     #[Groups(['product:read''product:write'])]
  210.     private ?float $gross_weight null;
  211.     #[ORM\Column(nullabletrue)]
  212.     #[Groups(['product:read''product:write'])]
  213.     private ?bool $go_by_weight null;
  214.     #[ORM\Column(nullabletrue)]
  215.     #[Groups(['product:read''product:write'])]
  216.     private ?float $packaging null;
  217.     #[ORM\ManyToOne(inversedBy'products')]
  218.     #[MaxDepth(1)]
  219.     #[Groups(['product:siteProduct''product:write'])]
  220.     private ?SiteProducts $siteProduct null;
  221.     #[Groups([ 'product:category''product:write'])]
  222.     #[ORM\ManyToMany(targetEntityCategory::class, inversedBy'products')]
  223.     #[MaxDepth(1)]
  224.     private Collection $category;
  225.     
  226.     #[Groups(['product:admin''product:write'])]
  227.     #[ORM\Column(length100nullabletrue)]
  228.     private ?string $oldCode null;
  229.     #[ORM\OneToMany(mappedBy'product'targetEntityUserLikeList::class)]
  230.     private Collection $userLikeLists;
  231.     #[Groups(['product:attributeItems''product:write''site_product:read'])]
  232.     #[ORM\ManyToMany(targetEntityAttributeItems::class, mappedBy'product')] 
  233.     private Collection $attributeItems;
  234.     #[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''site_product:read'])]
  235.     #[ORM\Column(nullabletrue)]
  236.     private ?bool $show null;
  237.     #[Groups(['product:storage''product:write''load_invoice:read''pre_order_product:read''pre_order:read''order:read''order_product:read''order_product:read''site_product:read'])]
  238.     #[ORM\ManyToOne(inversedBy'products')]
  239.     private ?Storage $storage null;
  240.     #[MaxDepth(2)]
  241.     #[Groups(['product:storageElement''product:write','order:read''order_product:read'])]
  242.     #[ORM\ManyToOne(inversedBy'products')]
  243.     private ?StorageElement $storageElement null;
  244.     #[ORM\OneToMany(mappedBy'product'targetEntityPrices::class)]
  245.     private Collection $prices;
  246.     #[Groups(['product:productBalanceInStorages''product:write''order_product:read''pre_order_product:read'])]
  247.     #[ORM\OneToMany(mappedBy'product'targetEntityProductBalanceInStorage::class)]
  248.     private Collection $productBalanceInStorages;
  249.     #[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',   'cat:read','site_product:read'])]
  250.     #[ORM\Column(nullabletrue)]
  251.     private ?float $balance null;
  252.     #[ApiProperty(writabletrue)]
  253.     #[ORM\OneToMany(mappedBy'product'targetEntityOrderProduct::class)]
  254.     private Collection $orderProducts;
  255.     #[Groups(['product:language''product:write'])]
  256.     #[ORM\ManyToOne(inversedBy'products')]
  257.     #[MaxDepth(1)]
  258.     private ?Languages $language null;
  259.     #[MaxDepth(1)]
  260.     #[Groups(['product:read''product:write''cat:read''attributes_items:read''attributes:read'])]
  261.     #[ORM\ManyToOne(targetEntityself::class, inversedBy'translations')]
  262.     private ?self $translation null;
  263.     #[MaxDepth(1)]
  264.     #[Groups(['product:read'])]
  265.     #[ORM\OneToMany(mappedBy'translation'targetEntityself::class)]
  266.     private Collection $translations;
  267.     #[Groups(['product:read''product:write''cat:read''user_like:read''pre_order_product:read''pre_order:read''order:read''order_product:read''site_product:read''product_releted:read'])]
  268.     #[ORM\ManyToOne(inversedBy'MainProducts')]
  269.     private ?MediaObject $mainMedia null;
  270.     #[Groups(['product:admin''product:write'])]
  271.     #[ORM\Column(nullabletrueoptions: ["default" => false])]
  272.     private ?bool $deleted false;
  273.     #[Groups(['product:admin''product:write'])]
  274.     #[ORM\Column(nullabletrue,  options: ["default" => 0])]
  275.     private ?int $categoryCnt 0;
  276.     #[Groups(['product:read''product:write''pre_order_product:read''pre_order:read''order:read''order_product:read''site_product:read'])]
  277.     #[ORM\Column(nullabletrue)]
  278.     private ?array $priceCategory null;
  279.     #[Groups(['product:comments''product:write'])]
  280.     #[ORM\OneToMany(mappedBy'product'targetEntityComments::class)]
  281.     private Collection $comments;
  282.     #[Groups(['product:read''product:write'])]
  283.     #[ORM\Column(nullabletrue)]
  284.     private ?bool $isSalle null;
  285.     #[Groups(['product:read''product:write'])]
  286.     #[ORM\Column(nullabletrue)]
  287.     private ?bool $isNew null;
  288.     #[Groups(['product:read''product:write'])]
  289.     #[ORM\Column(nullabletrue)]
  290.     private ?bool $isTop null;
  291.     #[Groups(['product:hover''product:write''product_releted:read'])]
  292.     #[ORM\ManyToOne(inversedBy'productsHover')]
  293.     private ?MediaObject $mainMediaHover null;
  294.     #[Groups(['productsReleteds:read''product:write'])]
  295.     #[ORM\OneToMany(mappedBy'product'targetEntityProductsReleted::class)]
  296.     private Collection $productsReleteds;
  297.     #[ORM\OneToMany(mappedBy'relatedProduct'targetEntityProductsReleted::class)]
  298.     private Collection $parentProductRelateds;
  299.     #[Groups(['product:read''product:write''product_releted:read'])]
  300.     #[ORM\Column(nullabletrue)]
  301.     private ?float $oldPrice null;
  302.     #[Groups(['product:read''product:write''product_releted:read'])]
  303.     #[ORM\Column(nullabletrue)]
  304.     private ?int $discountPercent null;
  305.     #[Groups(['product:read''product:write''pre_order_product:read''pre_order:read''order:read''order_product:read''site_product:read'])]
  306.     #[ORM\Column(typeTypes::DATETIME_MUTABLEnullabletrue)]
  307.     private ?\DateTimeInterface $dateLastPriceIncome null;
  308.     #[Groups(['product:read''product:write'])]
  309.     #[ORM\Column(nullabletrue)]
  310.     private ?array $video null;
  311.     #[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',   'cat:read','product_storage_balance:read''site_product:read''product_releted:read'])]
  312.     #[ORM\Column(nullabletrue)]
  313.     private ?bool $isVideo null;
  314.     #[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',   'cat:read','product_storage_balance:read''site_product:read''product_releted:read'])]
  315.     #[ORM\Column(nullabletrue)]
  316.     private ?bool $isFreeShipping null;
  317.     #[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',   'cat:read','product_storage_balance:read''site_product:read''product_releted:read'])]
  318.     #[ORM\Column(length255nullabletrue)]
  319.     private ?string $warrantyPeriod null;
  320.     #[Groups(['product:read''product:write'])]
  321.     #[ORM\Column(nullabletrue)]
  322.     private ?float $minBalance null;
  323.     #[Groups(['product:read''product:write'])]
  324.     #[ORM\Column(nullabletrue)]
  325.     private ?float $minBalanceAdmin null;
  326.     
  327.     #[Groups(['product:read''product:write'])]
  328.     #[ORM\Column(nullabletrue)]
  329.     private ?int $mainCategoryId null;
  330.     #[Groups(['product:read''product:write'])]
  331.     #[ORM\Column(nullabletrueoptions: ["default" => false])]
  332.     private ?bool $discontinued null;
  333.     /**
  334.      * @var Collection<int, Documents>
  335.      */
  336.     #[ORM\OneToMany(mappedBy'product'targetEntityDocuments::class)]
  337.     private Collection $documents;
  338.     public function __construct() {
  339.         $this->productInfos = new ArrayCollection();
  340.         $this->media = new ArrayCollection();
  341.         $this->incomingInvoiceProducts = new ArrayCollection();
  342.         $this->category = new ArrayCollection();
  343.         // $this->mediaObjects = new ArrayCollection();
  344.         $this->userLikeLists = new ArrayCollection();
  345.         $this->attributeItems = new ArrayCollection();
  346.         $this->prices = new ArrayCollection();
  347.         $this->productBalanceInStorages = new ArrayCollection();
  348.         $this->orderProducts = new ArrayCollection();
  349.         $this->products = new ArrayCollection();
  350.         $this->comments = new ArrayCollection();
  351.         $this->productsReleteds = new ArrayCollection();
  352.         $this->parentProductRelateds = new ArrayCollection();
  353.         // $this->mytranslations = new ArrayCollection();
  354.         $this->translations = new ArrayCollection();
  355.         $this->documents = new ArrayCollection();
  356.     }
  357.     public function getId(): ?int
  358.     {
  359.         return $this->id;
  360.     }
  361.     public function setId(string $id): self
  362.     {
  363.         $this->id $id;
  364.         return $this;
  365.     }
  366.     public function getName(): ?string
  367.     {
  368.         return $this->name;
  369.     }
  370.     public function setName(string $name): self
  371.     {
  372.         $this->name $name;
  373.         return $this;
  374.     }
  375.     public function getDateEntered(): ?\DateTimeInterface
  376.     {
  377.         return $this->date_entered;
  378.     }
  379.     // public function setDateEntered(?\DateTimeInterface $date_entered): self
  380.     // {
  381.     //     $this->date_entered = $date_entered;
  382.     //     return $this;
  383.     // }
  384.     public function getDateModified(): ?\DateTimeInterface
  385.     {
  386.         return $this->date_modified;
  387.     }
  388.     // public function setDateModified(?\DateTimeInterface $date_modified): self
  389.     // {
  390.     //     $this->date_modified = $date_modified;
  391.     //     return $this;
  392.     // }
  393.     public function getModifiedUser(): ?User
  394.     {
  395.         return $this->modified_user;
  396.     }
  397.     // public function setModifiedUserId(?User $modified_user_id): self
  398.     // {
  399.     //     $this->modified_user_id = $modified_user_id;
  400.     //     return $this;
  401.     // }
  402.     public function getCreatedBy(): ?User
  403.     {
  404.         return $this->created_by;
  405.     }
  406.     public function setCreatedBy(?User $created_by): self
  407.     {
  408.         $this->created_by $created_by;
  409.         return $this;
  410.     }
  411.     public function getDescription(): ?string
  412.     {
  413.         return $this->description;
  414.     }
  415.     public function setDescription(?string $description): self
  416.     {
  417.         $this->description $description;
  418.         return $this;
  419.     }
  420.     public function getCode1c(): ?string
  421.     {
  422.         return $this->code1c;
  423.     }
  424.     public function setCode1c(?string $code1c): self
  425.     {
  426.         $this->code1c $code1c;
  427.         return $this;
  428.     }
  429.     public function getBarcode(): ?string
  430.     {
  431.         return $this->barcode;
  432.     }
  433.     public function setBarcode(?string $barcode): self
  434.     {
  435.         $this->barcode $barcode;
  436.         return $this;
  437.     }
  438.     public function getStatus(): ?string
  439.     {
  440.         return $this->status;
  441.     }
  442.     public function setStatus(?string $status): self
  443.     {
  444.         $this->status $status;
  445.         return $this;
  446.     }
  447.     public function getPrice(): ?float
  448.     {
  449.         return $this->price;
  450.     }
  451.     public function setPrice(?float $price): self
  452.     {
  453.         $this->price $price;
  454.         return $this;
  455.     }
  456.     public function getPriceIncome(): ?float
  457.     {
  458.         return $this->priceIncome;
  459.     }
  460.     public function setPriceIncome(?float $priceIncome): self
  461.     {
  462.         $this->priceIncome $priceIncome;
  463.         return $this;
  464.     }
  465.     public function getMarkUp(): ?float
  466.     {
  467.         return $this->mark_up;
  468.     }
  469.     public function setMarkUp(?float $mark_up): self
  470.     {
  471.         $this->mark_up $mark_up;
  472.         return $this;
  473.     }
  474.     public function getMinMarkUp(): ?float
  475.     {
  476.         return $this->min_mark_up;
  477.     }
  478.     public function setMinMarkUp(float $min_mark_up): self
  479.     {
  480.         $this->min_mark_up $min_mark_up;
  481.         return $this;
  482.     }
  483.     public function getPackingType(): ?string
  484.     {
  485.         return $this->packing_type;
  486.     }
  487.     public function setPackingType(?string $packing_type): self
  488.     {
  489.         $this->packing_type $packing_type;
  490.         return $this;
  491.     }
  492.     public function getPackingTypeCount(): ?float
  493.     {
  494.         return $this->packing_type_count;
  495.     }
  496.     public function setPackingTypeCount(?float $packing_type_count): self
  497.     {
  498.         $this->packing_type_count $packing_type_count;
  499.         return $this;
  500.     }
  501.     public function getDiscounts(): ?int
  502.     {
  503.         return $this->discounts;
  504.     }
  505.     public function setDiscounts(?int $discounts): self
  506.     {
  507.         $this->discounts $discounts;
  508.         return $this;
  509.     }
  510.     public function getCountOrder(): ?int
  511.     {
  512.         return $this->count_order;
  513.     }
  514.     public function setCountOrder(?int $count_order): self
  515.     {
  516.         $this->count_order $count_order;
  517.         return $this;
  518.     }
  519.     public function getProductToOrder(): ?int
  520.     {
  521.         return $this->productToOrder;
  522.     }
  523.     public function setProductToOrder(?int $productToOrder): self
  524.     {
  525.         $this->productToOrder $productToOrder;
  526.         return $this;
  527.     }
  528.     public function getMeasurementUnit(): ?MeasurmentUnit
  529.     {
  530.         return $this->measurement_unit;
  531.     }
  532.     public function setMeasurementUnit(?MeasurmentUnit $measurement_unit_id): self
  533.     {
  534.         $this->measurement_unit $measurement_unit_id;
  535.         return $this;
  536.     }
  537.     /**
  538.      * @return Collection<int, ProductInfo>
  539.      */
  540.     public function getProductInfos(): Collection
  541.     {
  542.         return $this->productInfos;
  543.     }
  544.     public function addProductInfo(ProductInfo $productInfo): self
  545.     {
  546.         if (!$this->productInfos->contains($productInfo)) {
  547.             $this->productInfos->add($productInfo);
  548.             $productInfo->setProduct($this);
  549.         }
  550.         return $this;
  551.     }
  552.     public function removeProductInfo(ProductInfo $productInfo): self
  553.     {
  554.         if ($this->productInfos->removeElement($productInfo)) {
  555.             // set the owning side to null (unless already changed)
  556.             if ($productInfo->getProduct() === $this) {
  557.                 $productInfo->setProduct(null);
  558.             }
  559.         }
  560.         return $this;
  561.     }
  562.     /**
  563.      * @return Collection<int, MediaObject>
  564.      */
  565.     public function getMedia(): Collection
  566.     {
  567.         return $this->media;
  568.     }
  569.     public function addMedium(MediaObject $medium): self
  570.     {
  571.         if (!$this->media->contains($medium)) {
  572.             $this->media->add($medium);
  573.             $medium->setProduct($this);
  574.         }
  575.         return $this;
  576.     }
  577.     public function removeMedium(MediaObject $medium): self
  578.     {
  579.         if ($this->media->removeElement($medium)) {
  580.             // set the owning side to null (unless already changed)
  581.             if ($medium->getProduct() === $this) {
  582.                 $medium->setProduct(null);
  583.             }
  584.         }
  585.         return $this;
  586.     }
  587.     /**
  588.      * @return Collection<int, IncomingInvoiceProduct>
  589.      */
  590.     public function getIncomingInvoiceProducts(): Collection
  591.     {
  592.         return $this->incomingInvoiceProducts;
  593.     }
  594.     public function addIncomingInvoiceProduct(IncomingInvoiceProduct $incomingInvoiceProduct): self
  595.     {
  596.         if (!$this->incomingInvoiceProducts->contains($incomingInvoiceProduct)) {
  597.             $this->incomingInvoiceProducts->add($incomingInvoiceProduct);
  598.             $incomingInvoiceProduct->setProduct($this);
  599.         }
  600.         return $this;
  601.     }
  602.     public function removeIncomingInvoiceProduct(IncomingInvoiceProduct $incomingInvoiceProduct): self
  603.     {
  604.         if ($this->incomingInvoiceProducts->removeElement($incomingInvoiceProduct)) {
  605.             // set the owning side to null (unless already changed)
  606.             if ($incomingInvoiceProduct->getProduct() === $this) {
  607.                 $incomingInvoiceProduct->setProduct(null);
  608.             }
  609.         }
  610.         return $this;
  611.     }
  612.     #[ORM\PrePersist]
  613.     public function setCreatedAtValue(): void
  614.     {
  615.         $this->date_entered = new \DateTime();
  616.         // file_put_contents('/var/www/symfony_docker/public/errorrrrrr.log', $this->getCurrentUserId() . "\n", FILE_APPEND);
  617.         $this->created_by $this->getCurrentUserId();
  618.     }
  619.     // #[ORM\PrePersist]
  620.     #[ORM\PreUpdate]
  621.     public function setUpdatedAtValue(): void
  622.     {
  623.         // file_put_contents('/var/www/symfony_docker/public/errorrrrrr.log', "222222\n", FILE_APPEND);
  624.         $this->date_modified = new \DateTime();
  625.         $this->modified_user $this->getCurrentUserId();
  626.     }
  627.     public function getCurrentUserId(): ?User
  628.     {
  629.         // file_put_contents('/var/www/symfony_docker/public/errorrrrrr.log', print_r($this->security, true)."\n", FILE_APPEND);
  630.         if (!$this->security) {
  631.             return null;
  632.         }
  633.         $token $this->security->getToken();
  634.         if (!$token) {
  635.             return null;
  636.         }
  637.         $user $token->getUser();
  638.         if (!$user instanceof User) {
  639.             return null;
  640.         }
  641.         return $user;
  642.     }
  643.     public function __sleep()
  644.     {
  645.         return [
  646.             'modified_user',
  647.             // 'created_by',
  648.             // 'date_entered',
  649.             'date_modified'
  650.         ];
  651.     }
  652.     public function __wakeup(): void
  653.     {
  654.         $this->security null;
  655.     }
  656.     public function getArticle(): ?string
  657.     {
  658.         return $this->article;
  659.     }
  660.     public function setArticle(?string $article): self
  661.     {
  662.         $this->article $article;
  663.         return $this;
  664.     }
  665.     public function getNds(): ?float
  666.     {
  667.         return $this->nds;
  668.     }
  669.     public function setNds(?float $nds): self
  670.     {
  671.         $this->nds $nds;
  672.         return $this;
  673.     }
  674.     public function isService(): ?bool
  675.     {
  676.         return $this->service;
  677.     }
  678.     public function setService(?bool $service): self
  679.     {
  680.         $this->service $service;
  681.         return $this;
  682.     }
  683.     public function isTransportService(): ?bool
  684.     {
  685.         return $this->transport_service;
  686.     }
  687.     public function setTransportService(?bool $transport_service): self
  688.     {
  689.         $this->transport_service $transport_service;
  690.         return $this;
  691.     }
  692.     public function isExise(): ?bool
  693.     {
  694.         return $this->exise;
  695.     }
  696.     public function setExise(bool $exise): self
  697.     {
  698.         $this->exise $exise;
  699.         return $this;
  700.     }
  701.     public function isExpirationDate(): ?bool
  702.     {
  703.         return $this->expiration_date;
  704.     }
  705.     public function setExpirationDate(?bool $expiration_date): self
  706.     {
  707.         $this->expiration_date $expiration_date;
  708.         return $this;
  709.     }
  710.     public function getUnitVolume(): ?float
  711.     {
  712.         return $this->unit_volume;
  713.     }
  714.     public function setUnitVolume(?float $unit_volume): self
  715.     {
  716.         $this->unit_volume $unit_volume;
  717.         return $this;
  718.     }
  719.     public function getNetWeight(): ?float
  720.     {
  721.         return $this->net_weight;
  722.     }
  723.     public function setNetWeight(?float $net_weight): self
  724.     {
  725.         $this->net_weight $net_weight;
  726.         return $this;
  727.     }
  728.     public function getGrossWeight(): ?float
  729.     {
  730.         return $this->gross_weight;
  731.     }
  732.     public function setGrossWeight(?float $gross_weight): self
  733.     {
  734.         $this->gross_weight $gross_weight;
  735.         return $this;
  736.     }
  737.     public function isGoByWeight(): ?bool
  738.     {
  739.         return $this->go_by_weight;
  740.     }
  741.     public function setGoByWeight(?bool $go_by_weight): self
  742.     {
  743.         $this->go_by_weight $go_by_weight;
  744.         return $this;
  745.     }
  746.     public function getPackaging(): ?float
  747.     {
  748.         return $this->packaging;
  749.     }
  750.     public function setPackaging(?float $packaging): self
  751.     {
  752.         $this->packaging $packaging;
  753.         return $this;
  754.     }
  755.     public function getSiteProduct(): ?SiteProducts
  756.     {
  757.         return $this->siteProduct;
  758.     }
  759.     public function setSiteProduct(?SiteProducts $siteProduct): self
  760.     {
  761.         $this->siteProduct $siteProduct;
  762.         return $this;
  763.     }
  764.     /**
  765.      * @return Collection<int, Category>
  766.      */
  767.     public function getCategory(): Collection
  768.     {
  769.         return $this->category;
  770.     }
  771.     public function addCategory(Category $category): self
  772.     {
  773.         if (!$this->category->contains($category)) {
  774.             $this->category->add($category);
  775.         }
  776.         return $this;
  777.     }
  778.     public function removeCategory(Category $category): self
  779.     {
  780.         $this->category->removeElement($category);
  781.         return $this;
  782.     }
  783.     /**
  784.      * @return Collection<int, MediaObject>
  785.      */
  786.     public function getMediaObjects(): Collection
  787.     {
  788.         return $this->mediaObjects;
  789.     }
  790.     public function addMediaObject(MediaObject $mediaObject): self
  791.     {
  792.         if (!$this->mediaObjects->contains($mediaObject)) {
  793.             $this->mediaObjects->add($mediaObject);
  794.             $mediaObject->setProduct($this);
  795.         }
  796.         return $this;
  797.     }
  798.     public function removeMediaObject(MediaObject $mediaObject): self
  799.     {
  800.         if ($this->mediaObjects->removeElement($mediaObject)) {
  801.             // set the owning side to null (unless already changed)
  802.             if ($mediaObject->getProduct() === $this) {
  803.                 $mediaObject->setProduct(null);
  804.             }
  805.         }
  806.         return $this;
  807.     }
  808.     public function getOldCode(): ?string
  809.     {
  810.         return $this->oldCode;
  811.     }
  812.     public function setOldCode(string $oldCode): self
  813.     {
  814.         $this->oldCode $oldCode;
  815.         return $this;
  816.     }
  817.     /**
  818.      * @return Collection<int, UserLikeList>
  819.      */
  820.     public function getUserLikeLists(): Collection
  821.     {
  822.         return $this->userLikeLists;
  823.     }
  824.     public function addUserLikeList(UserLikeList $userLikeList): self
  825.     {
  826.         if (!$this->userLikeLists->contains($userLikeList)) {
  827.             $this->userLikeLists->add($userLikeList);
  828.             $userLikeList->setз�product($this);
  829.         }
  830.         return $this;
  831.     }
  832.     public function removeUserLikeList(UserLikeList $userLikeList): self
  833.     {
  834.         if ($this->userLikeLists->removeElement($userLikeList)) {
  835.             // set the owning side to null (unless already changed)
  836.             if ($userLikeList->getз�product() === $this) {
  837.                 $userLikeList->setз�product(null);
  838.             }
  839.         }
  840.         return $this;
  841.     }
  842.     /**
  843.      * @return Collection<int, AttributeItems>
  844.      */
  845.     public function getAttributeItems(): Collection
  846.     {
  847.         return $this->attributeItems;
  848.     }
  849.     public function addAttributeItem(AttributeItems $attributeItem): self
  850.     {
  851.         if (!$this->attributeItems->contains($attributeItem)) {
  852.             $this->attributeItems->add($attributeItem);
  853.             $attributeItem->addProduct($this);
  854.         }
  855.         return $this;
  856.     }
  857.     public function removeAttributeItem(AttributeItems $attributeItem): self
  858.     {
  859.         if ($this->attributeItems->removeElement($attributeItem)) {
  860.             $attributeItem->removeProduct($this);
  861.         }
  862.         return $this;
  863.     }
  864.     public function isShow(): ?bool
  865.     {
  866.         return $this->show;
  867.     }
  868.     public function setShow(?bool $show): self
  869.     {
  870.         $this->show $show;
  871.         return $this;
  872.     }
  873.     public function getStorage(): ?Storage
  874.     {
  875.         return $this->storage;
  876.     }
  877.     public function setStorage(?Storage $storage): self
  878.     {
  879.         $this->storage $storage;
  880.         return $this;
  881.     }
  882.     public function getStorageElement(): ?StorageElement
  883.     {
  884.         return $this->storageElement;
  885.     }
  886.     public function setStorageElement(?StorageElement $storageElement): self
  887.     {
  888.         $this->storageElement $storageElement;
  889.         return $this;
  890.     }
  891.     
  892.     /**
  893.      * @return Collection<int, Prices>
  894.      */
  895.     public function getPrices(): Collection
  896.     {
  897.         return $this->prices;
  898.     }
  899.     public function addPrice(Prices $price): static
  900.     {
  901.         if (!$this->prices->contains($price)) {
  902.             $this->prices->add($price);
  903.             $price->setAgreement($this);
  904.         }
  905.         return $this;
  906.     }
  907.     public function removePrice(Prices $price): static
  908.     {
  909.         if ($this->prices->removeElement($price)) {
  910.             // set the owning side to null (unless already changed)
  911.             if ($price->getAgreement() === $this) {
  912.                 $price->setAgreement(null);
  913.             }
  914.         }
  915.         return $this;
  916.     }
  917.     /**
  918.      * @return Collection<int, ProductBalanceInStorage>
  919.      */
  920.     public function getProductBalanceInStorages(): Collection
  921.     {
  922.         return $this->productBalanceInStorages;
  923.     }
  924.     public function addProductBalanceInStorage(ProductBalanceInStorage $productBalanceInStorage): self
  925.     {
  926.         if (!$this->productBalanceInStorages->contains($productBalanceInStorage)) {
  927.             $this->productBalanceInStorages->add($productBalanceInStorage);
  928.             $productBalanceInStorage->setProduct($this);
  929.         }
  930.         return $this;
  931.     }
  932.     public function removeProductBalanceInStorage(ProductBalanceInStorage $productBalanceInStorage): self
  933.     {
  934.         if ($this->productBalanceInStorages->removeElement($productBalanceInStorage)) {
  935.             // set the owning side to null (unless already changed)
  936.             if ($productBalanceInStorage->getProduct() === $this) {
  937.                 $productBalanceInStorage->setProduct(null);
  938.             }
  939.         }
  940.         return $this;
  941.     }
  942.     public function getBalance(): ?float
  943.     {
  944.         return $this->balance;
  945.     }
  946.     public function setBalance(?float $balance): self
  947.     {
  948.         $this->balance $balance;
  949.         return $this;
  950.     }
  951.     /**
  952.      * @return Collection<int, OrderProduct>
  953.      */
  954.     public function getOrderProducts(): Collection
  955.     {
  956.         return $this->orderProducts;
  957.     }
  958.     public function addOrderProduct(OrderProduct $orderProduct): self
  959.     {
  960.         if (!$this->orderProducts->contains($orderProduct)) {
  961.             $this->orderProducts->add($orderProduct);
  962.             $orderProduct->setOrder($this);
  963.         }
  964.         return $this;
  965.     }
  966.     public function removeOrderProduct(OrderProduct $orderProduct): self
  967.     {
  968.         if ($this->orderProducts->removeElement($orderProduct)) {
  969.             // set the owning side to null (unless already changed)
  970.             if ($orderProduct->getOrder() === $this) {
  971.                 $orderProduct->setOrder(null);
  972.             }
  973.         }
  974.         return $this;
  975.     }
  976.     public function getLanguage(): ?Languages
  977.     {
  978.         return $this->language;
  979.     }
  980.     public function setLanguage(?Languages $language): self
  981.     {
  982.         $this->language $language;
  983.         return $this;
  984.     }
  985.     public function getTranslation(): ?self
  986.     {
  987.         return $this->translation;
  988.     }
  989.     public function setTranslation(?self $translation): static
  990.     {
  991.         $this->translation $translation;
  992.         return $this;
  993.     }
  994.     /**
  995.      * @return Collection<int, self>
  996.      */
  997.     public function getTranslations(): Collection
  998.     {
  999.         return $this->translations;
  1000.     }
  1001.     public function addTranslation(self $translation): static
  1002.     {
  1003.         if (!$this->translations->contains($translation)) {
  1004.             $this->translations->add($translation);
  1005.             $translation->setTranslation($this);
  1006.         }
  1007.         return $this;
  1008.     }
  1009.     public function removeTranslation(self $translation): static
  1010.     {
  1011.         if ($this->translations->removeElement($translation)) {
  1012.             // set the owning side to null (unless already changed)
  1013.             if ($translation->getTranslation() === $this) {
  1014.                 $translation->setTranslation(null);
  1015.             }
  1016.         }
  1017.         return $this;
  1018.     }
  1019.     public function getMainMedia(): ?MediaObject
  1020.     {
  1021.         return $this->mainMedia;
  1022.     }
  1023.     public function setMainMedia(?MediaObject $mainMedia): self
  1024.     {
  1025.         $this->mainMedia $mainMedia;
  1026.         return $this;
  1027.     }
  1028.     public function isDeleted(): ?bool
  1029.     {
  1030.         return $this->deleted;
  1031.     }
  1032.     public function setDeleted(?bool $deleted): static
  1033.     {
  1034.         $this->deleted $deleted;
  1035.         return $this;
  1036.     }
  1037.     public function getCategoryCnt(): ?int
  1038.     {
  1039.         return $this->categoryCnt;
  1040.     }
  1041.     public function setCategoryCnt(?int $categoryCnt): static
  1042.     {
  1043.         $this->categoryCnt $categoryCnt;
  1044.         return $this;
  1045.     }
  1046.     public function getPriceCategory(): ?array
  1047.     {
  1048.         return $this->priceCategory;
  1049.     }
  1050.     public function setPriceCategory(?array $priceCategory): static
  1051.     {
  1052.         $this->priceCategory $priceCategory;
  1053.         return $this;
  1054.     }
  1055.     /**
  1056.      * @return Collection<int, Comments>
  1057.      */
  1058.     public function getComments(): Collection
  1059.     {
  1060.         return $this->comments;
  1061.     }
  1062.     public function addComment(Comments $comment): static
  1063.     {
  1064.         if (!$this->comments->contains($comment)) {
  1065.             $this->comments->add($comment);
  1066.             $comment->setProduct($this);
  1067.         }
  1068.         return $this;
  1069.     }
  1070.     public function removeComment(Comments $comment): static
  1071.     {
  1072.         if ($this->comments->removeElement($comment)) {
  1073.             // set the owning side to null (unless already changed)
  1074.             if ($comment->getProduct() === $this) {
  1075.                 $comment->setProduct(null);
  1076.             }
  1077.         }
  1078.         return $this;
  1079.     }
  1080.     public function isIsSalle(): ?bool
  1081.     {
  1082.         return $this->isSalle;
  1083.     }
  1084.     public function setIsSalle(?bool $isSalle): static
  1085.     {
  1086.         $this->isSalle $isSalle;
  1087.         return $this;
  1088.     }
  1089.     public function isIsNew(): ?bool
  1090.     {
  1091.         return $this->isNew;
  1092.     }
  1093.     public function setIsNew(?bool $isNew): static
  1094.     {
  1095.         $this->isNew $isNew;
  1096.         return $this;
  1097.     }
  1098.     public function isIsTop(): ?bool
  1099.     {
  1100.         return $this->isTop;
  1101.     }
  1102.     public function setIsTop(?bool $isTop): static
  1103.     {
  1104.         $this->isTop $isTop;
  1105.         return $this;
  1106.     }
  1107.     public function getMainMediaHover(): ?MediaObject
  1108.     {
  1109.         return $this->mainMediaHover;
  1110.     }
  1111.     public function setMainMediaHover(?MediaObject $mainMediaHover): static
  1112.     {
  1113.         $this->mainMediaHover $mainMediaHover;
  1114.         return $this;
  1115.     }
  1116.     /**
  1117.      * @return Collection<int, ProductsReleted>
  1118.      */
  1119.     public function getProductsReleteds(): Collection
  1120.     {
  1121.         return $this->productsReleteds;
  1122.     }
  1123.     public function addProductsReleted(ProductsReleted $productsReleted): static
  1124.     {
  1125.         if (!$this->productsReleteds->contains($productsReleted)) {
  1126.             $this->productsReleteds->add($productsReleted);
  1127.             $productsReleted->setProduct($this);
  1128.         }
  1129.         return $this;
  1130.     }
  1131.     public function removeProductsReleted(ProductsReleted $productsReleted): static
  1132.     {
  1133.         if ($this->productsReleteds->removeElement($productsReleted)) {
  1134.             // set the owning side to null (unless already changed)
  1135.             if ($productsReleted->getProduct() === $this) {
  1136.                 $productsReleted->setProduct(null);
  1137.             }
  1138.         }
  1139.         return $this;
  1140.     }
  1141.     /**
  1142.      * @return Collection<int, ProductsReleted>
  1143.      */
  1144.     public function getParentProductRelateds(): Collection
  1145.     {
  1146.         return $this->parentProductRelateds;
  1147.     }
  1148.     public function addParentProductRelated(ProductsReleted $parentProductRelated): static
  1149.     {
  1150.         if (!$this->parentProductRelateds->contains($parentProductRelated)) {
  1151.             $this->parentProductRelateds->add($parentProductRelated);
  1152.             $parentProductRelated->setRelatedProduct($this);
  1153.         }
  1154.         return $this;
  1155.     }
  1156.     public function removeParentProductRelated(ProductsReleted $parentProductRelated): static
  1157.     {
  1158.         if ($this->parentProductRelateds->removeElement($parentProductRelated)) {
  1159.             // set the owning side to null (unless already changed)
  1160.             if ($parentProductRelated->getRelatedProduct() === $this) {
  1161.                 $parentProductRelated->setRelatedProduct(null);
  1162.             }
  1163.         }
  1164.         return $this;
  1165.     }
  1166.     public function getOldPrice(): ?float
  1167.     {
  1168.         return $this->oldPrice;
  1169.     }
  1170.     public function setOldPrice(?float $oldPrice): static
  1171.     {
  1172.         $this->oldPrice $oldPrice;
  1173.         return $this;
  1174.     }
  1175.     public function getDiscountPercent(): ?int
  1176.     {
  1177.         return $this->discountPercent;
  1178.     }
  1179.     public function setDiscountPercent(?int $discountPercent): static
  1180.     {
  1181.         $this->discountPercent $discountPercent;
  1182.         return $this;
  1183.     }
  1184.     public function getDateLastPriceIncome(): ?\DateTimeInterface
  1185.     {
  1186.         return $this->dateLastPriceIncome;
  1187.     }
  1188.     public function setDateLastPriceIncome(?\DateTimeInterface $dateLastPriceIncome): static
  1189.     {
  1190.         $this->dateLastPriceIncome $dateLastPriceIncome;
  1191.         
  1192.         return $this;
  1193.     }
  1194.     
  1195.     public function getVideo(): ?array
  1196.     {
  1197.         return $this->video;
  1198.     }
  1199.     public function setVideo(?array $video): static
  1200.     {
  1201.         $this->video $video;
  1202.         return $this;
  1203.     }
  1204.     public function isIsVideo(): ?bool
  1205.     {
  1206.         return $this->isVideo;
  1207.     }
  1208.     public function setIsVideo(?bool $isVideo): static
  1209.     {
  1210.         $this->isVideo $isVideo;
  1211.         return $this;
  1212.     }
  1213.     public function isIsFreeShipping(): ?bool
  1214.     {
  1215.         return $this->isFreeShipping;
  1216.     }
  1217.     public function setIsFreeShipping(?bool $isFreeShipping): static
  1218.     {
  1219.         $this->isFreeShipping $isFreeShipping;
  1220.         return $this;
  1221.     }
  1222.     public function getWarrantyPeriod(): ?string
  1223.     {
  1224.         return $this->warrantyPeriod;
  1225.     }
  1226.     public function setWarrantyPeriod(?string $warrantyPeriod): static
  1227.     {
  1228.         $this->warrantyPeriod $warrantyPeriod;
  1229.         return $this;
  1230.     }
  1231.     public function getMinBalance(): ?float
  1232.     {
  1233.         return $this->minBalance;
  1234.     }
  1235.     public function setMinBalance(?float $minBalance): static
  1236.     {
  1237.         $this->minBalance $minBalance;
  1238.         return $this;
  1239.     }
  1240.     public function getMinBalanceAdmin(): ?float
  1241.     {
  1242.         return $this->minBalanceAdmin;
  1243.     }
  1244.     public function setMinBalanceAdmin(?float $minBalanceAdmin): static
  1245.     {
  1246.         $this->minBalanceAdmin $minBalanceAdmin;
  1247.         return $this;
  1248.     }
  1249.     public function getMainCategoryId(): ?int
  1250.     {
  1251.         return $this->mainCategoryId;
  1252.     }
  1253.     public function setMainCategoryId(?int $mainCategoryId): static
  1254.     {
  1255.         $this->mainCategoryId $mainCategoryId;
  1256.         return $this;
  1257.     }
  1258.     public function isDiscontinued(): ?bool
  1259.     {
  1260.         return $this->discontinued;
  1261.     }
  1262.     public function setDiscontinued(?bool $discontinued): static
  1263.     {
  1264.         $this->discontinued $discontinued;
  1265.         return $this;
  1266.     }
  1267.     /**
  1268.      * @return Collection<int, Documents>
  1269.      */
  1270.     public function getDocuments(): Collection
  1271.     {
  1272.         return $this->documents;
  1273.     }
  1274.     public function addDocument(Documents $document): static
  1275.     {
  1276.         if (!$this->documents->contains($document)) {
  1277.             $this->documents->add($document);
  1278.             $document->setProduct($this);
  1279.         }
  1280.         return $this;
  1281.     }
  1282.     public function removeDocument(Documents $document): static
  1283.     {
  1284.         if ($this->documents->removeElement($document)) {
  1285.             // set the owning side to null (unless already changed)
  1286.             if ($document->getProduct() === $this) {
  1287.                 $document->setProduct(null);
  1288.             }
  1289.         }
  1290.         return $this;
  1291.     }
  1292. }