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.     #[ORM\JoinColumn(
  294.         name'main_media_hover_id',
  295.         referencedColumnName'id',
  296.         nullabletrue,
  297.         onDelete'SET NULL'
  298.     )]
  299.     private ?MediaObject $mainMediaHover null;
  300.     #[Groups(['productsReleteds:read''product:write'])]
  301.     #[ORM\OneToMany(mappedBy'product'targetEntityProductsReleted::class)]
  302.     private Collection $productsReleteds;
  303.     #[ORM\OneToMany(mappedBy'relatedProduct'targetEntityProductsReleted::class)]
  304.     private Collection $parentProductRelateds;
  305.     #[Groups(['product:read''product:write''product_releted:read'])]
  306.     #[ORM\Column(nullabletrue)]
  307.     private ?float $oldPrice null;
  308.     #[Groups(['product:read''product:write''product_releted:read'])]
  309.     #[ORM\Column(nullabletrue)]
  310.     private ?int $discountPercent null;
  311.     #[Groups(['product:read''product:write''pre_order_product:read''pre_order:read''order:read''order_product:read''site_product:read'])]
  312.     #[ORM\Column(typeTypes::DATETIME_MUTABLEnullabletrue)]
  313.     private ?\DateTimeInterface $dateLastPriceIncome null;
  314.     #[Groups(['product:read''product:write'])]
  315.     #[ORM\Column(nullabletrue)]
  316.     private ?array $video 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(nullabletrue)]
  319.     private ?bool $isVideo null;
  320.     #[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'])]
  321.     #[ORM\Column(nullabletrue)]
  322.     private ?bool $isFreeShipping null;
  323.     #[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'])]
  324.     #[ORM\Column(length255nullabletrue)]
  325.     private ?string $warrantyPeriod null;
  326.     #[Groups(['product:read''product:write'])]
  327.     #[ORM\Column(nullabletrue)]
  328.     private ?float $minBalance null;
  329.     #[Groups(['product:read''product:write'])]
  330.     #[ORM\Column(nullabletrue)]
  331.     private ?float $minBalanceAdmin null;
  332.     
  333.     #[Groups(['product:read''product:write'])]
  334.     #[ORM\Column(nullabletrue)]
  335.     private ?int $mainCategoryId null;
  336.     #[Groups(['product:read''product:write'])]
  337.     #[ORM\Column(nullabletrueoptions: ["default" => false])]
  338.     private ?bool $discontinued null;
  339.     /**
  340.      * @var Collection<int, Documents>
  341.      */
  342.     #[ORM\OneToMany(mappedBy'product'targetEntityDocuments::class)]
  343.     private Collection $documents;
  344.     #[Groups(['product:read''product:write''site_product:read'])]
  345.     #[ORM\Column(length255nullabletrue)]
  346.     private ?string $seoTitle null;
  347.     #[Groups(['product:read''product:write''site_product:read'])]
  348.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  349.     private ?string $seoDescription null;
  350.     /**
  351.      * @var Collection<int, ProductDiscount>
  352.      */
  353.     #[ORM\OneToMany(mappedBy'product'targetEntityProductDiscount::class)]
  354.     private Collection $productDiscounts;
  355.     #[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'])]
  356.     #[ORM\Column(nullabletrue)]
  357.     private ?float $sallePrice null;
  358.     #[Groups([ 'product:admin''product:write''order_product:read''product_releted:read'])]
  359.     #[ORM\Column(nullabletrue)]
  360.     private ?float $normalPrice null;
  361.     public function __construct() {
  362.         $this->productInfos = new ArrayCollection();
  363.         $this->media = new ArrayCollection();
  364.         $this->incomingInvoiceProducts = new ArrayCollection();
  365.         $this->category = new ArrayCollection();
  366.         // $this->mediaObjects = new ArrayCollection();
  367.         $this->userLikeLists = new ArrayCollection();
  368.         $this->attributeItems = new ArrayCollection();
  369.         $this->prices = new ArrayCollection();
  370.         $this->productBalanceInStorages = new ArrayCollection();
  371.         $this->orderProducts = new ArrayCollection();
  372.         $this->products = new ArrayCollection();
  373.         $this->comments = new ArrayCollection();
  374.         $this->productsReleteds = new ArrayCollection();
  375.         $this->parentProductRelateds = new ArrayCollection();
  376.         // $this->mytranslations = new ArrayCollection();
  377.         $this->translations = new ArrayCollection();
  378.         $this->documents = new ArrayCollection();
  379.         $this->productDiscounts = new ArrayCollection();
  380.     }
  381.     public function getId(): ?int
  382.     {
  383.         return $this->id;
  384.     }
  385.     public function setId(string $id): self
  386.     {
  387.         $this->id $id;
  388.         return $this;
  389.     }
  390.     public function getName(): ?string
  391.     {
  392.         return $this->name;
  393.     }
  394.     public function setName(string $name): self
  395.     {
  396.         $this->name $name;
  397.         return $this;
  398.     }
  399.     public function getDateEntered(): ?\DateTimeInterface
  400.     {
  401.         return $this->date_entered;
  402.     }
  403.     // public function setDateEntered(?\DateTimeInterface $date_entered): self
  404.     // {
  405.     //     $this->date_entered = $date_entered;
  406.     //     return $this;
  407.     // }
  408.     public function getDateModified(): ?\DateTimeInterface
  409.     {
  410.         return $this->date_modified;
  411.     }
  412.     // public function setDateModified(?\DateTimeInterface $date_modified): self
  413.     // {
  414.     //     $this->date_modified = $date_modified;
  415.     //     return $this;
  416.     // }
  417.     public function getModifiedUser(): ?User
  418.     {
  419.         return $this->modified_user;
  420.     }
  421.     // public function setModifiedUserId(?User $modified_user_id): self
  422.     // {
  423.     //     $this->modified_user_id = $modified_user_id;
  424.     //     return $this;
  425.     // }
  426.     public function getCreatedBy(): ?User
  427.     {
  428.         return $this->created_by;
  429.     }
  430.     public function setCreatedBy(?User $created_by): self
  431.     {
  432.         $this->created_by $created_by;
  433.         return $this;
  434.     }
  435.     public function getDescription(): ?string
  436.     {
  437.         return $this->description;
  438.     }
  439.     public function setDescription(?string $description): self
  440.     {
  441.         $this->description $description;
  442.         return $this;
  443.     }
  444.     public function getCode1c(): ?string
  445.     {
  446.         return $this->code1c;
  447.     }
  448.     public function setCode1c(?string $code1c): self
  449.     {
  450.         $this->code1c $code1c;
  451.         return $this;
  452.     }
  453.     public function getBarcode(): ?string
  454.     {
  455.         return $this->barcode;
  456.     }
  457.     public function setBarcode(?string $barcode): self
  458.     {
  459.         $this->barcode $barcode;
  460.         return $this;
  461.     }
  462.     public function getStatus(): ?string
  463.     {
  464.         return $this->status;
  465.     }
  466.     public function setStatus(?string $status): self
  467.     {
  468.         $this->status $status;
  469.         return $this;
  470.     }
  471.     public function getPrice(): ?float
  472.     {
  473.         return $this->price;
  474.     }
  475.     public function setPrice(?float $price): self
  476.     {
  477.         $this->price $price;
  478.         return $this;
  479.     }
  480.     public function getPriceIncome(): ?float
  481.     {
  482.         return $this->priceIncome;
  483.     }
  484.     public function setPriceIncome(?float $priceIncome): self
  485.     {
  486.         $this->priceIncome $priceIncome;
  487.         return $this;
  488.     }
  489.     public function getMarkUp(): ?float
  490.     {
  491.         return $this->mark_up;
  492.     }
  493.     public function setMarkUp(?float $mark_up): self
  494.     {
  495.         $this->mark_up $mark_up;
  496.         return $this;
  497.     }
  498.     public function getMinMarkUp(): ?float
  499.     {
  500.         return $this->min_mark_up;
  501.     }
  502.     public function setMinMarkUp(float $min_mark_up): self
  503.     {
  504.         $this->min_mark_up $min_mark_up;
  505.         return $this;
  506.     }
  507.     public function getPackingType(): ?string
  508.     {
  509.         return $this->packing_type;
  510.     }
  511.     public function setPackingType(?string $packing_type): self
  512.     {
  513.         $this->packing_type $packing_type;
  514.         return $this;
  515.     }
  516.     public function getPackingTypeCount(): ?float
  517.     {
  518.         return $this->packing_type_count;
  519.     }
  520.     public function setPackingTypeCount(?float $packing_type_count): self
  521.     {
  522.         $this->packing_type_count $packing_type_count;
  523.         return $this;
  524.     }
  525.     public function getDiscounts(): ?int
  526.     {
  527.         return $this->discounts;
  528.     }
  529.     public function setDiscounts(?int $discounts): self
  530.     {
  531.         $this->discounts $discounts;
  532.         return $this;
  533.     }
  534.     public function getCountOrder(): ?int
  535.     {
  536.         return $this->count_order;
  537.     }
  538.     public function setCountOrder(?int $count_order): self
  539.     {
  540.         $this->count_order $count_order;
  541.         return $this;
  542.     }
  543.     public function getProductToOrder(): ?int
  544.     {
  545.         return $this->productToOrder;
  546.     }
  547.     public function setProductToOrder(?int $productToOrder): self
  548.     {
  549.         $this->productToOrder $productToOrder;
  550.         return $this;
  551.     }
  552.     public function getMeasurementUnit(): ?MeasurmentUnit
  553.     {
  554.         return $this->measurement_unit;
  555.     }
  556.     public function setMeasurementUnit(?MeasurmentUnit $measurement_unit_id): self
  557.     {
  558.         $this->measurement_unit $measurement_unit_id;
  559.         return $this;
  560.     }
  561.     /**
  562.      * @return Collection<int, ProductInfo>
  563.      */
  564.     public function getProductInfos(): Collection
  565.     {
  566.         return $this->productInfos;
  567.     }
  568.     public function addProductInfo(ProductInfo $productInfo): self
  569.     {
  570.         if (!$this->productInfos->contains($productInfo)) {
  571.             $this->productInfos->add($productInfo);
  572.             $productInfo->setProduct($this);
  573.         }
  574.         return $this;
  575.     }
  576.     public function removeProductInfo(ProductInfo $productInfo): self
  577.     {
  578.         if ($this->productInfos->removeElement($productInfo)) {
  579.             // set the owning side to null (unless already changed)
  580.             if ($productInfo->getProduct() === $this) {
  581.                 $productInfo->setProduct(null);
  582.             }
  583.         }
  584.         return $this;
  585.     }
  586.     /**
  587.      * @return Collection<int, MediaObject>
  588.      */
  589.     public function getMedia(): Collection
  590.     {
  591.         return $this->media;
  592.     }
  593.     public function addMedium(MediaObject $medium): self
  594.     {
  595.         if (!$this->media->contains($medium)) {
  596.             $this->media->add($medium);
  597.             $medium->setProduct($this);
  598.         }
  599.         return $this;
  600.     }
  601.     public function removeMedium(MediaObject $medium): self
  602.     {
  603.         if ($this->media->removeElement($medium)) {
  604.             // set the owning side to null (unless already changed)
  605.             if ($medium->getProduct() === $this) {
  606.                 $medium->setProduct(null);
  607.             }
  608.         }
  609.         return $this;
  610.     }
  611.     /**
  612.      * @return Collection<int, IncomingInvoiceProduct>
  613.      */
  614.     public function getIncomingInvoiceProducts(): Collection
  615.     {
  616.         return $this->incomingInvoiceProducts;
  617.     }
  618.     public function addIncomingInvoiceProduct(IncomingInvoiceProduct $incomingInvoiceProduct): self
  619.     {
  620.         if (!$this->incomingInvoiceProducts->contains($incomingInvoiceProduct)) {
  621.             $this->incomingInvoiceProducts->add($incomingInvoiceProduct);
  622.             $incomingInvoiceProduct->setProduct($this);
  623.         }
  624.         return $this;
  625.     }
  626.     public function removeIncomingInvoiceProduct(IncomingInvoiceProduct $incomingInvoiceProduct): self
  627.     {
  628.         if ($this->incomingInvoiceProducts->removeElement($incomingInvoiceProduct)) {
  629.             // set the owning side to null (unless already changed)
  630.             if ($incomingInvoiceProduct->getProduct() === $this) {
  631.                 $incomingInvoiceProduct->setProduct(null);
  632.             }
  633.         }
  634.         return $this;
  635.     }
  636.     #[ORM\PrePersist]
  637.     public function setCreatedAtValue(): void
  638.     {
  639.         $this->date_entered = new \DateTime();
  640.         // file_put_contents('/var/www/symfony_docker/public/errorrrrrr.log', $this->getCurrentUserId() . "\n", FILE_APPEND);
  641.         $this->created_by $this->getCurrentUserId();
  642.     }
  643.     // #[ORM\PrePersist]
  644.     #[ORM\PreUpdate]
  645.     public function setUpdatedAtValue(): void
  646.     {
  647.         // file_put_contents('/var/www/symfony_docker/public/errorrrrrr.log', "222222\n", FILE_APPEND);
  648.         $this->date_modified = new \DateTime();
  649.         $this->modified_user $this->getCurrentUserId();
  650.     }
  651.     public function getCurrentUserId(): ?User
  652.     {
  653.         // file_put_contents('/var/www/symfony_docker/public/errorrrrrr.log', print_r($this->security, true)."\n", FILE_APPEND);
  654.         if (!$this->security) {
  655.             return null;
  656.         }
  657.         $token $this->security->getToken();
  658.         if (!$token) {
  659.             return null;
  660.         }
  661.         $user $token->getUser();
  662.         if (!$user instanceof User) {
  663.             return null;
  664.         }
  665.         return $user;
  666.     }
  667.     public function __sleep()
  668.     {
  669.         return [
  670.             'modified_user',
  671.             // 'created_by',
  672.             // 'date_entered',
  673.             'date_modified'
  674.         ];
  675.     }
  676.     public function __wakeup(): void
  677.     {
  678.         $this->security null;
  679.     }
  680.     public function getArticle(): ?string
  681.     {
  682.         return $this->article;
  683.     }
  684.     public function setArticle(?string $article): self
  685.     {
  686.         $this->article $article;
  687.         return $this;
  688.     }
  689.     public function getNds(): ?float
  690.     {
  691.         return $this->nds;
  692.     }
  693.     public function setNds(?float $nds): self
  694.     {
  695.         $this->nds $nds;
  696.         return $this;
  697.     }
  698.     public function isService(): ?bool
  699.     {
  700.         return $this->service;
  701.     }
  702.     public function setService(?bool $service): self
  703.     {
  704.         $this->service $service;
  705.         return $this;
  706.     }
  707.     public function isTransportService(): ?bool
  708.     {
  709.         return $this->transport_service;
  710.     }
  711.     public function setTransportService(?bool $transport_service): self
  712.     {
  713.         $this->transport_service $transport_service;
  714.         return $this;
  715.     }
  716.     public function isExise(): ?bool
  717.     {
  718.         return $this->exise;
  719.     }
  720.     public function setExise(bool $exise): self
  721.     {
  722.         $this->exise $exise;
  723.         return $this;
  724.     }
  725.     public function isExpirationDate(): ?bool
  726.     {
  727.         return $this->expiration_date;
  728.     }
  729.     public function setExpirationDate(?bool $expiration_date): self
  730.     {
  731.         $this->expiration_date $expiration_date;
  732.         return $this;
  733.     }
  734.     public function getUnitVolume(): ?float
  735.     {
  736.         return $this->unit_volume;
  737.     }
  738.     public function setUnitVolume(?float $unit_volume): self
  739.     {
  740.         $this->unit_volume $unit_volume;
  741.         return $this;
  742.     }
  743.     public function getNetWeight(): ?float
  744.     {
  745.         return $this->net_weight;
  746.     }
  747.     public function setNetWeight(?float $net_weight): self
  748.     {
  749.         $this->net_weight $net_weight;
  750.         return $this;
  751.     }
  752.     public function getGrossWeight(): ?float
  753.     {
  754.         return $this->gross_weight;
  755.     }
  756.     public function setGrossWeight(?float $gross_weight): self
  757.     {
  758.         $this->gross_weight $gross_weight;
  759.         return $this;
  760.     }
  761.     public function isGoByWeight(): ?bool
  762.     {
  763.         return $this->go_by_weight;
  764.     }
  765.     public function setGoByWeight(?bool $go_by_weight): self
  766.     {
  767.         $this->go_by_weight $go_by_weight;
  768.         return $this;
  769.     }
  770.     public function getPackaging(): ?float
  771.     {
  772.         return $this->packaging;
  773.     }
  774.     public function setPackaging(?float $packaging): self
  775.     {
  776.         $this->packaging $packaging;
  777.         return $this;
  778.     }
  779.     public function getSiteProduct(): ?SiteProducts
  780.     {
  781.         return $this->siteProduct;
  782.     }
  783.     public function setSiteProduct(?SiteProducts $siteProduct): self
  784.     {
  785.         $this->siteProduct $siteProduct;
  786.         return $this;
  787.     }
  788.     /**
  789.      * @return Collection<int, Category>
  790.      */
  791.     public function getCategory(): Collection
  792.     {
  793.         return $this->category;
  794.     }
  795.     public function addCategory(Category $category): self
  796.     {
  797.         if (!$this->category->contains($category)) {
  798.             $this->category->add($category);
  799.         }
  800.         return $this;
  801.     }
  802.     public function removeCategory(Category $category): self
  803.     {
  804.         $this->category->removeElement($category);
  805.         return $this;
  806.     }
  807.     /**
  808.      * @return Collection<int, MediaObject>
  809.      */
  810.     public function getMediaObjects(): Collection
  811.     {
  812.         return $this->mediaObjects;
  813.     }
  814.     public function addMediaObject(MediaObject $mediaObject): self
  815.     {
  816.         if (!$this->mediaObjects->contains($mediaObject)) {
  817.             $this->mediaObjects->add($mediaObject);
  818.             $mediaObject->setProduct($this);
  819.         }
  820.         return $this;
  821.     }
  822.     public function removeMediaObject(MediaObject $mediaObject): self
  823.     {
  824.         if ($this->mediaObjects->removeElement($mediaObject)) {
  825.             // set the owning side to null (unless already changed)
  826.             if ($mediaObject->getProduct() === $this) {
  827.                 $mediaObject->setProduct(null);
  828.             }
  829.         }
  830.         return $this;
  831.     }
  832.     public function getOldCode(): ?string
  833.     {
  834.         return $this->oldCode;
  835.     }
  836.     public function setOldCode(string $oldCode): self
  837.     {
  838.         $this->oldCode $oldCode;
  839.         return $this;
  840.     }
  841.     /**
  842.      * @return Collection<int, UserLikeList>
  843.      */
  844.     public function getUserLikeLists(): Collection
  845.     {
  846.         return $this->userLikeLists;
  847.     }
  848.     public function addUserLikeList(UserLikeList $userLikeList): self
  849.     {
  850.         if (!$this->userLikeLists->contains($userLikeList)) {
  851.             $this->userLikeLists->add($userLikeList);
  852.             $userLikeList->setз�product($this);
  853.         }
  854.         return $this;
  855.     }
  856.     public function removeUserLikeList(UserLikeList $userLikeList): self
  857.     {
  858.         if ($this->userLikeLists->removeElement($userLikeList)) {
  859.             // set the owning side to null (unless already changed)
  860.             if ($userLikeList->getз�product() === $this) {
  861.                 $userLikeList->setз�product(null);
  862.             }
  863.         }
  864.         return $this;
  865.     }
  866.     /**
  867.      * @return Collection<int, AttributeItems>
  868.      */
  869.     public function getAttributeItems(): Collection
  870.     {
  871.         return $this->attributeItems;
  872.     }
  873.     public function addAttributeItem(AttributeItems $attributeItem): self
  874.     {
  875.         if (!$this->attributeItems->contains($attributeItem)) {
  876.             $this->attributeItems->add($attributeItem);
  877.             $attributeItem->addProduct($this);
  878.         }
  879.         return $this;
  880.     }
  881.     public function removeAttributeItem(AttributeItems $attributeItem): self
  882.     {
  883.         if ($this->attributeItems->removeElement($attributeItem)) {
  884.             $attributeItem->removeProduct($this);
  885.         }
  886.         return $this;
  887.     }
  888.     public function isShow(): ?bool
  889.     {
  890.         return $this->show;
  891.     }
  892.     public function setShow(?bool $show): self
  893.     {
  894.         $this->show $show;
  895.         return $this;
  896.     }
  897.     public function getStorage(): ?Storage
  898.     {
  899.         return $this->storage;
  900.     }
  901.     public function setStorage(?Storage $storage): self
  902.     {
  903.         $this->storage $storage;
  904.         return $this;
  905.     }
  906.     public function getStorageElement(): ?StorageElement
  907.     {
  908.         return $this->storageElement;
  909.     }
  910.     public function setStorageElement(?StorageElement $storageElement): self
  911.     {
  912.         $this->storageElement $storageElement;
  913.         return $this;
  914.     }
  915.     
  916.     /**
  917.      * @return Collection<int, Prices>
  918.      */
  919.     public function getPrices(): Collection
  920.     {
  921.         return $this->prices;
  922.     }
  923.     public function addPrice(Prices $price): static
  924.     {
  925.         if (!$this->prices->contains($price)) {
  926.             $this->prices->add($price);
  927.             $price->setAgreement($this);
  928.         }
  929.         return $this;
  930.     }
  931.     public function removePrice(Prices $price): static
  932.     {
  933.         if ($this->prices->removeElement($price)) {
  934.             // set the owning side to null (unless already changed)
  935.             if ($price->getAgreement() === $this) {
  936.                 $price->setAgreement(null);
  937.             }
  938.         }
  939.         return $this;
  940.     }
  941.     /**
  942.      * @return Collection<int, ProductBalanceInStorage>
  943.      */
  944.     public function getProductBalanceInStorages(): Collection
  945.     {
  946.         return $this->productBalanceInStorages;
  947.     }
  948.     public function addProductBalanceInStorage(ProductBalanceInStorage $productBalanceInStorage): self
  949.     {
  950.         if (!$this->productBalanceInStorages->contains($productBalanceInStorage)) {
  951.             $this->productBalanceInStorages->add($productBalanceInStorage);
  952.             $productBalanceInStorage->setProduct($this);
  953.         }
  954.         return $this;
  955.     }
  956.     public function removeProductBalanceInStorage(ProductBalanceInStorage $productBalanceInStorage): self
  957.     {
  958.         if ($this->productBalanceInStorages->removeElement($productBalanceInStorage)) {
  959.             // set the owning side to null (unless already changed)
  960.             if ($productBalanceInStorage->getProduct() === $this) {
  961.                 $productBalanceInStorage->setProduct(null);
  962.             }
  963.         }
  964.         return $this;
  965.     }
  966.     public function getBalance(): ?float
  967.     {
  968.         return $this->balance;
  969.     }
  970.     public function setBalance(?float $balance): self
  971.     {
  972.         $this->balance $balance;
  973.         return $this;
  974.     }
  975.     /**
  976.      * @return Collection<int, OrderProduct>
  977.      */
  978.     public function getOrderProducts(): Collection
  979.     {
  980.         return $this->orderProducts;
  981.     }
  982.     public function addOrderProduct(OrderProduct $orderProduct): self
  983.     {
  984.         if (!$this->orderProducts->contains($orderProduct)) {
  985.             $this->orderProducts->add($orderProduct);
  986.             $orderProduct->setOrder($this);
  987.         }
  988.         return $this;
  989.     }
  990.     public function removeOrderProduct(OrderProduct $orderProduct): self
  991.     {
  992.         if ($this->orderProducts->removeElement($orderProduct)) {
  993.             // set the owning side to null (unless already changed)
  994.             if ($orderProduct->getOrder() === $this) {
  995.                 $orderProduct->setOrder(null);
  996.             }
  997.         }
  998.         return $this;
  999.     }
  1000.     public function getLanguage(): ?Languages
  1001.     {
  1002.         return $this->language;
  1003.     }
  1004.     public function setLanguage(?Languages $language): self
  1005.     {
  1006.         $this->language $language;
  1007.         return $this;
  1008.     }
  1009.     public function getTranslation(): ?self
  1010.     {
  1011.         return $this->translation;
  1012.     }
  1013.     public function setTranslation(?self $translation): static
  1014.     {
  1015.         $this->translation $translation;
  1016.         return $this;
  1017.     }
  1018.     /**
  1019.      * @return Collection<int, self>
  1020.      */
  1021.     public function getTranslations(): Collection
  1022.     {
  1023.         return $this->translations;
  1024.     }
  1025.     public function addTranslation(self $translation): static
  1026.     {
  1027.         if (!$this->translations->contains($translation)) {
  1028.             $this->translations->add($translation);
  1029.             $translation->setTranslation($this);
  1030.         }
  1031.         return $this;
  1032.     }
  1033.     public function removeTranslation(self $translation): static
  1034.     {
  1035.         if ($this->translations->removeElement($translation)) {
  1036.             // set the owning side to null (unless already changed)
  1037.             if ($translation->getTranslation() === $this) {
  1038.                 $translation->setTranslation(null);
  1039.             }
  1040.         }
  1041.         return $this;
  1042.     }
  1043.     public function getMainMedia(): ?MediaObject
  1044.     {
  1045.         return $this->mainMedia;
  1046.     }
  1047.     public function setMainMedia(?MediaObject $mainMedia): self
  1048.     {
  1049.         $this->mainMedia $mainMedia;
  1050.         return $this;
  1051.     }
  1052.     public function isDeleted(): ?bool
  1053.     {
  1054.         return $this->deleted;
  1055.     }
  1056.     public function setDeleted(?bool $deleted): static
  1057.     {
  1058.         $this->deleted $deleted;
  1059.         return $this;
  1060.     }
  1061.     public function getCategoryCnt(): ?int
  1062.     {
  1063.         return $this->categoryCnt;
  1064.     }
  1065.     public function setCategoryCnt(?int $categoryCnt): static
  1066.     {
  1067.         $this->categoryCnt $categoryCnt;
  1068.         return $this;
  1069.     }
  1070.     public function getPriceCategory(): ?array
  1071.     {
  1072.         return $this->priceCategory;
  1073.     }
  1074.     public function setPriceCategory(?array $priceCategory): static
  1075.     {
  1076.         $this->priceCategory $priceCategory;
  1077.         return $this;
  1078.     }
  1079.     /**
  1080.      * @return Collection<int, Comments>
  1081.      */
  1082.     public function getComments(): Collection
  1083.     {
  1084.         return $this->comments;
  1085.     }
  1086.     public function addComment(Comments $comment): static
  1087.     {
  1088.         if (!$this->comments->contains($comment)) {
  1089.             $this->comments->add($comment);
  1090.             $comment->setProduct($this);
  1091.         }
  1092.         return $this;
  1093.     }
  1094.     public function removeComment(Comments $comment): static
  1095.     {
  1096.         if ($this->comments->removeElement($comment)) {
  1097.             // set the owning side to null (unless already changed)
  1098.             if ($comment->getProduct() === $this) {
  1099.                 $comment->setProduct(null);
  1100.             }
  1101.         }
  1102.         return $this;
  1103.     }
  1104.     public function isIsSalle(): ?bool
  1105.     {
  1106.         return $this->isSalle;
  1107.     }
  1108.     public function setIsSalle(?bool $isSalle): static
  1109.     {
  1110.         $this->isSalle $isSalle;
  1111.         return $this;
  1112.     }
  1113.     public function isIsNew(): ?bool
  1114.     {
  1115.         return $this->isNew;
  1116.     }
  1117.     public function setIsNew(?bool $isNew): static
  1118.     {
  1119.         $this->isNew $isNew;
  1120.         return $this;
  1121.     }
  1122.     public function isIsTop(): ?bool
  1123.     {
  1124.         return $this->isTop;
  1125.     }
  1126.     public function setIsTop(?bool $isTop): static
  1127.     {
  1128.         $this->isTop $isTop;
  1129.         return $this;
  1130.     }
  1131.     public function getMainMediaHover(): ?MediaObject
  1132.     {
  1133.         return $this->mainMediaHover;
  1134.     }
  1135.     public function setMainMediaHover(?MediaObject $mainMediaHover): static
  1136.     {
  1137.         $this->mainMediaHover $mainMediaHover;
  1138.         return $this;
  1139.     }
  1140.     /**
  1141.      * @return Collection<int, ProductsReleted>
  1142.      */
  1143.     public function getProductsReleteds(): Collection
  1144.     {
  1145.         return $this->productsReleteds;
  1146.     }
  1147.     public function addProductsReleted(ProductsReleted $productsReleted): static
  1148.     {
  1149.         if (!$this->productsReleteds->contains($productsReleted)) {
  1150.             $this->productsReleteds->add($productsReleted);
  1151.             $productsReleted->setProduct($this);
  1152.         }
  1153.         return $this;
  1154.     }
  1155.     public function removeProductsReleted(ProductsReleted $productsReleted): static
  1156.     {
  1157.         if ($this->productsReleteds->removeElement($productsReleted)) {
  1158.             // set the owning side to null (unless already changed)
  1159.             if ($productsReleted->getProduct() === $this) {
  1160.                 $productsReleted->setProduct(null);
  1161.             }
  1162.         }
  1163.         return $this;
  1164.     }
  1165.     /**
  1166.      * @return Collection<int, ProductsReleted>
  1167.      */
  1168.     public function getParentProductRelateds(): Collection
  1169.     {
  1170.         return $this->parentProductRelateds;
  1171.     }
  1172.     public function addParentProductRelated(ProductsReleted $parentProductRelated): static
  1173.     {
  1174.         if (!$this->parentProductRelateds->contains($parentProductRelated)) {
  1175.             $this->parentProductRelateds->add($parentProductRelated);
  1176.             $parentProductRelated->setRelatedProduct($this);
  1177.         }
  1178.         return $this;
  1179.     }
  1180.     public function removeParentProductRelated(ProductsReleted $parentProductRelated): static
  1181.     {
  1182.         if ($this->parentProductRelateds->removeElement($parentProductRelated)) {
  1183.             // set the owning side to null (unless already changed)
  1184.             if ($parentProductRelated->getRelatedProduct() === $this) {
  1185.                 $parentProductRelated->setRelatedProduct(null);
  1186.             }
  1187.         }
  1188.         return $this;
  1189.     }
  1190.     public function getOldPrice(): ?float
  1191.     {
  1192.         return $this->oldPrice;
  1193.     }
  1194.     public function setOldPrice(?float $oldPrice): static
  1195.     {
  1196.         $this->oldPrice $oldPrice;
  1197.         return $this;
  1198.     }
  1199.     public function getDiscountPercent(): ?int
  1200.     {
  1201.         return $this->discountPercent;
  1202.     }
  1203.     public function setDiscountPercent(?int $discountPercent): static
  1204.     {
  1205.         $this->discountPercent $discountPercent;
  1206.         return $this;
  1207.     }
  1208.     public function getDateLastPriceIncome(): ?\DateTimeInterface
  1209.     {
  1210.         return $this->dateLastPriceIncome;
  1211.     }
  1212.     public function setDateLastPriceIncome(?\DateTimeInterface $dateLastPriceIncome): static
  1213.     {
  1214.         $this->dateLastPriceIncome $dateLastPriceIncome;
  1215.         
  1216.         return $this;
  1217.     }
  1218.     
  1219.     public function getVideo(): ?array
  1220.     {
  1221.         return $this->video;
  1222.     }
  1223.     public function setVideo(?array $video): static
  1224.     {
  1225.         $this->video $video;
  1226.         return $this;
  1227.     }
  1228.     public function isIsVideo(): ?bool
  1229.     {
  1230.         return $this->isVideo;
  1231.     }
  1232.     public function setIsVideo(?bool $isVideo): static
  1233.     {
  1234.         $this->isVideo $isVideo;
  1235.         return $this;
  1236.     }
  1237.     public function isIsFreeShipping(): ?bool
  1238.     {
  1239.         return $this->isFreeShipping;
  1240.     }
  1241.     public function setIsFreeShipping(?bool $isFreeShipping): static
  1242.     {
  1243.         $this->isFreeShipping $isFreeShipping;
  1244.         return $this;
  1245.     }
  1246.     public function getWarrantyPeriod(): ?string
  1247.     {
  1248.         return $this->warrantyPeriod;
  1249.     }
  1250.     public function setWarrantyPeriod(?string $warrantyPeriod): static
  1251.     {
  1252.         $this->warrantyPeriod $warrantyPeriod;
  1253.         return $this;
  1254.     }
  1255.     public function getMinBalance(): ?float
  1256.     {
  1257.         return $this->minBalance;
  1258.     }
  1259.     public function setMinBalance(?float $minBalance): static
  1260.     {
  1261.         $this->minBalance $minBalance;
  1262.         return $this;
  1263.     }
  1264.     public function getMinBalanceAdmin(): ?float
  1265.     {
  1266.         return $this->minBalanceAdmin;
  1267.     }
  1268.     public function setMinBalanceAdmin(?float $minBalanceAdmin): static
  1269.     {
  1270.         $this->minBalanceAdmin $minBalanceAdmin;
  1271.         return $this;
  1272.     }
  1273.     public function getMainCategoryId(): ?int
  1274.     {
  1275.         return $this->mainCategoryId;
  1276.     }
  1277.     public function setMainCategoryId(?int $mainCategoryId): static
  1278.     {
  1279.         $this->mainCategoryId $mainCategoryId;
  1280.         return $this;
  1281.     }
  1282.     public function isDiscontinued(): ?bool
  1283.     {
  1284.         return $this->discontinued;
  1285.     }
  1286.     public function setDiscontinued(?bool $discontinued): static
  1287.     {
  1288.         $this->discontinued $discontinued;
  1289.         return $this;
  1290.     }
  1291.     /**
  1292.      * @return Collection<int, Documents>
  1293.      */
  1294.     public function getDocuments(): Collection
  1295.     {
  1296.         return $this->documents;
  1297.     }
  1298.     public function addDocument(Documents $document): static
  1299.     {
  1300.         if (!$this->documents->contains($document)) {
  1301.             $this->documents->add($document);
  1302.             $document->setProduct($this);
  1303.         }
  1304.         return $this;
  1305.     }
  1306.     public function removeDocument(Documents $document): static
  1307.     {
  1308.         if ($this->documents->removeElement($document)) {
  1309.             // set the owning side to null (unless already changed)
  1310.             if ($document->getProduct() === $this) {
  1311.                 $document->setProduct(null);
  1312.             }
  1313.         }
  1314.         return $this;
  1315.     }
  1316.     public function getSeoTitle(): ?string
  1317.     {
  1318.         return $this->seoTitle;
  1319.     }
  1320.     public function setSeoTitle(?string $seoTitle): static
  1321.     {
  1322.         $this->seoTitle $seoTitle;
  1323.         return $this;
  1324.     }
  1325.     public function getSeoDescription(): ?string
  1326.     {
  1327.         return $this->seoDescription;
  1328.     }
  1329.     public function setSeoDescription(?string $seoDescription): static
  1330.     {
  1331.         $this->seoDescription $seoDescription;
  1332.         return $this;
  1333.     }
  1334.     /**
  1335.      * @return Collection<int, ProductDiscount>
  1336.      */
  1337.     public function getProductDiscounts(): Collection
  1338.     {
  1339.         return $this->productDiscounts;
  1340.     }
  1341.     public function addProductDiscount(ProductDiscount $productDiscount): static
  1342.     {
  1343.         if (!$this->productDiscounts->contains($productDiscount)) {
  1344.             $this->productDiscounts->add($productDiscount);
  1345.             $productDiscount->setProduct($this);
  1346.         }
  1347.         return $this;
  1348.     }
  1349.     public function removeProductDiscount(ProductDiscount $productDiscount): static
  1350.     {
  1351.         if ($this->productDiscounts->removeElement($productDiscount)) {
  1352.             // set the owning side to null (unless already changed)
  1353.             if ($productDiscount->getProduct() === $this) {
  1354.                 $productDiscount->setProduct(null);
  1355.             }
  1356.         }
  1357.         return $this;
  1358.     }
  1359.     public function getSallePrice(): ?float
  1360.     {
  1361.         return $this->sallePrice;
  1362.     }
  1363.     public function setSallePrice(?float $sallePrice): static
  1364.     {
  1365.         $this->sallePrice $sallePrice;
  1366.         return $this;
  1367.     }
  1368.     public function getNormalPrice(): ?float
  1369.     {
  1370.         return $this->normalPrice;
  1371.     }
  1372.     public function setNormalPrice(?float $normalPrice): static
  1373.     {
  1374.         $this->normalPrice $normalPrice;
  1375.         return $this;
  1376.     }
  1377. }