ProductService
extends TransactionalService
in package
Class ProductService `
Table of Contents
Constants
- PRODUCT_PRICE_SHEET = ['sellPrice03' => 'getSellPrice03', 'sellPrice36' => 'getSellPrice36', 'sellPrice69' => 'getSellPrice69', 'sellPrice912' => 'getSellPrice912', 'sellPrice12plus' => 'getSellPrice12plus', 'newPriceProduct' => 'getSellPrice69']
Properties
- $configService : ConfigService|object
- $container : mixed
- $em : EntityManager
- $logService : LogService
- $productQtyLogService : mixed
- $productRepository : mixed
- $queueService : QueueServiceInterface
- $bigBuyService : ProductService
- $header : mixed
- $newProductService : NewProductService
- $productPriceSheetService : mixed
- $warehouseProductQtyLogService : WarehouseProductQtyLogService
Methods
- addRepository() : void
- Add a repository to this service
- addService() : void
- Add a service to this service
- calculateNewQtyForComposedProductByProduct() : int|null
- construct() : mixed
- /** SaleProductService constructor.
- downloadCropperImage() : string
- export() : StreamedResponse
- Exporting sales
- exportXls() : mixed
- Exporting as Xls
- find() : mixed
- findAll() : mixed
- findBy() : mixed
- findByName() : mixed
- findOneByAmazonAsin() : mixed
- findOneBySku() : Product
- generateNewEanForProduct() : ProductService
- generateProductDataMapping() : array<string|int, mixed>
- Map V2 data to v1
- getArrivedDateContainerProduct() : mixed
- getArriving() : array<string|int, mixed>|int|string
- getArrivingCommand() : array<string|int, mixed>|int|mixed|string|null
- getCalculatedDropShipSellPrice() : mixed
- getComposedProduct() : array<string|int, mixed>|int|string
- getComposedProducts() : array<string|int, mixed>
- Composed products
- getContainerArrivalsForProduct() : string
- Récupère les informations d'arrivée de conteneurs pour un produit au format container_warehousename:qty,container_warehousename2:qty Utilise ContainerService pour calculer les quantités réelles
- getContainerForComposedProduct() : mixed
- getDispoQty() : mixed
- getEntityManager() : EntityManager
- Getter of the Entity Manager
- getLastArrived() : int|mixed|string|null
- getLastCommandProductValue() : void
- getMenzzoDispo() : int|string
- Get Menzzo Dispo
- getNumberOfProductsByOptionId() : int
- Get number of products mapping
- getOldIdParent() : mixed
- Get old id parent
- getProductArrivals() : array<string|int, mixed>
- Get Product arrivals
- getProductAttributeValue() : string
- getProductAvailabilityInWarehouses() : string
- Génère la valeur de l'attribut product_availability_in_warehouses au format Warehouse1:qty,Warehouse2:qty,Warehouse3:qty
- getProductByFeedId() : Product|bool
- Get product by
- getProductDecorImage() : mixed
- getProductPackagesNumber() : int
- getProductRepository() : mixed
- getProductsWithUpcomingContainers() : array<int, bool>
- Retourne les produits ayant des containers à venir (non "arrived" ou "canceled")
- getQtyCmdProcessing() : mixed
- getQtyContenaireCmdProcessing() : mixed
- getQtyContenaireNotArrived() : mixed
- getRelatedProductIds() : array<string|int, mixed>|string
- getRepo() : ProductRepository
- Get ProductRepository
- getSellingPriceHtProduct() : void
- getWeightPerPackage() : array<string|int, mixed>
- This function is no longer maintained and should not be used
- inheritAutoEndFromParent() : array<string|int, mixed>
- initEdenRedPrice() : void
- initPackProduct() : void
- isAlreadyHaveValidReduction() : bool
- isEligibleReduction() : bool
- logProductActivationDeactivation() : void
- Log Product Activation/Deactivation
- moveWarehouseProductQty() : array<string|int, mixed>
- onProductPriceChange() : mixed
- productStockMailAlert() : int
- Stock alert email
- remove() : mixed
- removeOldCategoryFromProduct() : mixed
- save() : Product
- Save a Product
- saveFromApi() : bool
- Saving product information from menzzo API
- searchAlertNoCmd() : mixed
- searchEmplacement() : Paginator|mixed
- searchEndOfPoductStock() : Paginator|int|mixed|string
- searchPoductDictionaries() : mixed
- searchProductPrice() : mixed
- searchProductPurchases() : mixed
- search a Sales purchases
- searchProductStock() : mixed
- Search a product stock
- sendWarehouseDataToRabbitMQ() : void
- Envoie les données de stock entrepôt vers RabbitMQ
- setEntityManager() : mixed
- Setter of the Entity Manager
- simulateNewPriceFromBaseOfCalculation() : void
- updateAsirProductStatus() : array<string|int, mixed>|bool|string|JsonResponse
- Update ASIR Product status
- updateProductDispo() : mixed
- $availability needs to in format format Y-m-d
- updateProductInStore() : Product
- updateProductQty() : string
- Update Product Qty
- updateProductStatus() : array<string|int, mixed>|bool|string|JsonResponse
- Update Product status
- updateWarehouseProductsQty() : array<string|int, mixed>
- activateProductCompositionChilds() : bool
- calculateProductTotalQyt() : int
- desactivateProductCompositionChilds() : bool
- Deactivates all child products associated with the given product by updating their status.
- exportCsv() : mixed
- Exporting as csv
- exportPDF() : mixed
- Exporting as csv
- getCompositProductsParentsInfos() : array<string|int, mixed>
- Retrieves information about parent products based on the provided composition items.
- getProductIdParent() : string
- Get product id parent
- getProductImage() : string
- Get product image from data
- isStatusUpdateAllowed() : bool
- Determines if a status update is allowed based on the provided composite product information and status.
- logWarehouseProductQty() : void
- processProductComposition() : bool
- Processes the composition of a product, validating its components and performing necessary actions based on the given status.
Constants
PRODUCT_PRICE_SHEET
public
mixed
PRODUCT_PRICE_SHEET
= ['sellPrice03' => 'getSellPrice03', 'sellPrice36' => 'getSellPrice36', 'sellPrice69' => 'getSellPrice69', 'sellPrice912' => 'getSellPrice912', 'sellPrice12plus' => 'getSellPrice12plus', 'newPriceProduct' => 'getSellPrice69']
Properties
$configService
protected
ConfigService|object
$configService
$container
protected
mixed
$container
$em
protected
EntityManager
$em
The Entity Manager
$logService
protected
LogService
$logService
$productQtyLogService
protected
mixed
$productQtyLogService
$productRepository
protected
mixed
$productRepository
$queueService
protected
QueueServiceInterface
$queueService
$bigBuyService
private
ProductService
$bigBuyService
$header
private
mixed
$header
= ['id' => 'ID', 'sku' => 'Sku', 'name' => 'Nom', 'dispo' => 'Dispo', 'qty' => 'Qté', 'manufacturer' => 'Fabricant', 'lastdescharge' => 'Dernier déchargement', 'lastqty' => 'Qté', 'dispoone' => 'Dispo (arrivage 1)', 'dispooneqty' => 'Qté', 'dispotwo' => 'Dispo (arrivage 2)', 'dispotwoqty' => 'Qté', 'arrivalcmd' => 'Arrivage (commande)', 'arrivalqty' => 'Arrivage (qté)', 'otherarrival' => 'Autres arrivages', 'salesevendays' => 'Vente les 7 derniers jours', 'salethirtydays' => 'Vente les 30 derniers jours', 'saleninetydays' => 'Vente les 90 derniers jours', 'saleQtyNoStock' => 'Commandes non livre', 'reference' => 'Container Ref', 'shipment' => 'Shipment Date', 'arrival' => 'Arrivage Date', 'a' => 'ID', 'created_at' => 'Crée', 'arrival_at' => 'estimation arrivage', 'status' => 'Status', 'volume' => 'volume', 'dispoarrival' => 'Dispo (arrivage)', 'qtyordered' => 'Qty en contenaire', 'pendingorder' => 'Qty en attente de livraison', 'recommendation' => 'Recommandation', 'buyingPrice' => 'Prix d\'achat', 'costPrice' => 'Prix de revient', 'date' => 'Date', 'disponew' => 'Dispo Nouv', 'emplacement' => 'Emplacement', 'shippingfees' => 'Prix de transport', 'price' => 'Prix', 'drop' => 'Drop', 'promo' => 'Promo', 'special_price' => 'Prix spécial', 'depot' => 'Depot', 'special_price_from' => 'Prix spécial de', 'special_price_to' => 'Prix spécial a', 'action' => 'Action', 'old' => 'Ancienne quantité', 'new' => 'Nouvelle quantité', 'msg' => 'Message', 'user' => 'Utilisateur', 'namel' => 'Nom FR', 'trans' => 'Traduit ?', 'isSync' => 'Synchronizé', 'fdp' => 'FDP', 'up_stairs_extra_shipping_amount' => 'Frais de port', 'currentBuyingPrice' => "Prix d'achat", 'currency' => "Devise prix d'achat", 'img1' => 'image_1', 'img2' => 'image_2', 'sellingPriceHt' => 'Prix de revente HT', 'shippingAmount' => 'Prix de transport', 'packagesNumber' => 'Nb colis', 'composition_offre' => 'composition offre', 'id_newProduct' => 'newProduct id']
$newProductService
private
NewProductService
$newProductService
$productPriceSheetService
private
mixed
$productPriceSheetService
$warehouseProductQtyLogService
private
WarehouseProductQtyLogService
$warehouseProductQtyLogService
Methods
addRepository()
Add a repository to this service
public
addRepository(int $key, string $class) : void
Parameters
- $key : int
-
Key
- $class : string
-
Class
addService()
Add a service to this service
public
addService(int $key, mixed $service) : void
Parameters
- $key : int
-
Key
- $service : mixed
calculateNewQtyForComposedProductByProduct()
public
calculateNewQtyForComposedProductByProduct(array<string|int, mixed> $product) : int|null
Parameters
- $product : array<string|int, mixed>
Return values
int|nullconstruct()
/** SaleProductService constructor.
public
construct(ContainerInterface $container, LogService $logService, QueueServiceInterface $queueService, ProductService $bigBuyService, ProductPriceSheetService $productPriceSheetService, NewProductService $newProductService, WarehouseProductQtyLogService $warehouseProductQtyLogService) : mixed
Parameters
- $container : ContainerInterface
- $logService : LogService
- $queueService : QueueServiceInterface
- $bigBuyService : ProductService
- $productPriceSheetService : ProductPriceSheetService
- $newProductService : NewProductService
- $warehouseProductQtyLogService : WarehouseProductQtyLogService
downloadCropperImage()
public
downloadCropperImage(mixed $product, mixed $Folder, mixed $fileName[, mixed $forSynchronise = false ]) : string
Parameters
- $product : mixed
- $Folder : mixed
- $fileName : mixed
- $forSynchronise : mixed = false
Return values
stringexport()
Exporting sales
public
export(mixed $title, mixed $data, mixed $columns, mixed $format[, array<string|int, mixed> $customHeader = [] ]) : StreamedResponse
Parameters
- $title : mixed
- $data : mixed
- $columns : mixed
- $format : mixed
- $customHeader : array<string|int, mixed> = []
Return values
StreamedResponseexportXls()
Exporting as Xls
public
exportXls(mixed $data, mixed $columns, mixed $title[, bool $toFile = false ]) : mixed
Parameters
- $data : mixed
- $columns : mixed
- $title : mixed
- $toFile : bool = false
find()
public
find(mixed $id) : mixed
Parameters
- $id : mixed
findAll()
public
findAll() : mixed
You should not use this function
Tags
findBy()
public
findBy([mixed $params = [] ]) : mixed
Parameters
- $params : mixed = []
findByName()
public
findByName(mixed $name) : mixed
Parameters
- $name : mixed
findOneByAmazonAsin()
public
findOneByAmazonAsin(mixed $asin) : mixed
Parameters
- $asin : mixed
findOneBySku()
public
findOneBySku(mixed $sku) : Product
Parameters
- $sku : mixed
Return values
ProductgenerateNewEanForProduct()
public
generateNewEanForProduct(mixed $sku) : ProductService
Parameters
- $sku : mixed
Tags
Return values
ProductServicegenerateProductDataMapping()
Map V2 data to v1
public
generateProductDataMapping(mixed $productData) : array<string|int, mixed>
Parameters
- $productData : mixed
Tags
Return values
array<string|int, mixed>getArrivedDateContainerProduct()
public
getArrivedDateContainerProduct(mixed $arrayIds) : mixed
Parameters
- $arrayIds : mixed
Tags
getArriving()
public
getArriving(mixed $id) : array<string|int, mixed>|int|string
Parameters
- $id : mixed
Return values
array<string|int, mixed>|int|stringgetArrivingCommand()
public
getArrivingCommand(mixed $id[, false $all = false ]) : array<string|int, mixed>|int|mixed|string|null
Parameters
- $id : mixed
- $all : false = false
Tags
Return values
array<string|int, mixed>|int|mixed|string|nullgetCalculatedDropShipSellPrice()
public
getCalculatedDropShipSellPrice(mixed $menzzoPrice) : mixed
Parameters
- $menzzoPrice : mixed
getComposedProduct()
public
getComposedProduct(mixed $sku) : array<string|int, mixed>|int|string
Parameters
- $sku : mixed
Return values
array<string|int, mixed>|int|stringgetComposedProducts()
Composed products
public
getComposedProducts(mixed $sku) : array<string|int, mixed>
Parameters
- $sku : mixed
Return values
array<string|int, mixed>getContainerArrivalsForProduct()
Récupère les informations d'arrivée de conteneurs pour un produit au format container_warehousename:qty,container_warehousename2:qty Utilise ContainerService pour calculer les quantités réelles
public
getContainerArrivalsForProduct(int $productId) : string
Parameters
- $productId : int
Return values
stringgetContainerForComposedProduct()
public
getContainerForComposedProduct(mixed $containers) : mixed
Parameters
- $containers : mixed
getDispoQty()
public
getDispoQty(mixed $idprod, mixed $start, mixed $end) : mixed
Parameters
- $idprod : mixed
- $start : mixed
- $end : mixed
getEntityManager()
Getter of the Entity Manager
public
getEntityManager() : EntityManager
Return values
EntityManagergetLastArrived()
public
getLastArrived(mixed $id) : int|mixed|string|null
Parameters
- $id : mixed
Return values
int|mixed|string|nullgetLastCommandProductValue()
public
getLastCommandProductValue(mixed $product) : void
Parameters
- $product : mixed
getMenzzoDispo()
Get Menzzo Dispo
public
getMenzzoDispo(mixed $dispo) : int|string
Parameters
- $dispo : mixed
Return values
int|stringgetNumberOfProductsByOptionId()
Get number of products mapping
public
getNumberOfProductsByOptionId(mixed $optionId) : int
Parameters
- $optionId : mixed
Return values
intgetOldIdParent()
Get old id parent
public
getOldIdParent(mixed $productData, mixed $idParent) : mixed
Parameters
- $productData : mixed
- $idParent : mixed
getProductArrivals()
Get Product arrivals
public
getProductArrivals(int $productId[, null $fromDate = null ]) : array<string|int, mixed>
Parameters
- $productId : int
- $fromDate : null = null
Tags
Return values
array<string|int, mixed>getProductAttributeValue()
public
getProductAttributeValue(Product $product, mixed $code[, int $storeId = 0 ]) : string
Parameters
- $product : Product
- $code : mixed
- $storeId : int = 0
Return values
stringgetProductAvailabilityInWarehouses()
Génère la valeur de l'attribut product_availability_in_warehouses au format Warehouse1:qty,Warehouse2:qty,Warehouse3:qty
public
getProductAvailabilityInWarehouses(int $productId) : string
Parameters
- $productId : int
Return values
stringgetProductByFeedId()
Get product by
public
getProductByFeedId(mixed $feedId[, int $storeId = 3 ]) : Product|bool
Parameters
- $feedId : mixed
- $storeId : int = 3
Return values
Product|boolgetProductDecorImage()
public
getProductDecorImage(mixed $product, mixed $arrayImage) : mixed
Parameters
- $product : mixed
- $arrayImage : mixed
getProductPackagesNumber()
public
getProductPackagesNumber(Product $product) : int
Parameters
- $product : Product
Return values
intgetProductRepository()
public
getProductRepository() : mixed
getProductsWithUpcomingContainers()
Retourne les produits ayant des containers à venir (non "arrived" ou "canceled")
public
getProductsWithUpcomingContainers() : array<int, bool>
Return values
array<int, bool>getQtyCmdProcessing()
public
getQtyCmdProcessing(mixed $id) : mixed
Parameters
- $id : mixed
getQtyContenaireCmdProcessing()
public
getQtyContenaireCmdProcessing(mixed $id) : mixed
Parameters
- $id : mixed
getQtyContenaireNotArrived()
public
getQtyContenaireNotArrived(mixed $id) : mixed
Parameters
- $id : mixed
getRelatedProductIds()
public
getRelatedProductIds(mixed $productData) : array<string|int, mixed>|string
Parameters
- $productData : mixed
Tags
Return values
array<string|int, mixed>|stringgetRepo()
Get ProductRepository
public
getRepo() : ProductRepository
Return values
ProductRepositorygetSellingPriceHtProduct()
public
getSellingPriceHtProduct(mixed $product) : void
Parameters
- $product : mixed
Tags
getWeightPerPackage()
This function is no longer maintained and should not be used
public
getWeightPerPackage(Product $product) : array<string|int, mixed>
Parameters
- $product : Product
Tags
Return values
array<string|int, mixed>inheritAutoEndFromParent()
public
inheritAutoEndFromParent(array<string|int, mixed> $products) : array<string|int, mixed>
Parameters
- $products : array<string|int, mixed>
Return values
array<string|int, mixed>initEdenRedPrice()
public
initEdenRedPrice(NewProduct $newProduct) : void
Parameters
- $newProduct : NewProduct
initPackProduct()
public
initPackProduct(NewProduct $newProduct) : void
Parameters
- $newProduct : NewProduct
isAlreadyHaveValidReduction()
public
isAlreadyHaveValidReduction(mixed $productId, mixed $specialPrice, mixed $specialPriceFrom, mixed $specialPriceTo) : bool
Parameters
- $productId : mixed
- $specialPrice : mixed
- $specialPriceFrom : mixed
- $specialPriceTo : mixed
Tags
Return values
boolisEligibleReduction()
public
isEligibleReduction() : bool
Tags
Return values
boollogProductActivationDeactivation()
Log Product Activation/Deactivation
public
logProductActivationDeactivation(Product $product, string $action, string $user) : void
Parameters
- $product : Product
- $action : string
- $user : string
moveWarehouseProductQty()
public
moveWarehouseProductQty(mixed $productId, mixed $fromWarehouseId, mixed $toWarehouseId, mixed $warehouseQty, mixed $user, mixed $warehouseCmt) : array<string|int, mixed>
Parameters
- $productId : mixed
- $fromWarehouseId : mixed
- $toWarehouseId : mixed
- $warehouseQty : mixed
- $user : mixed
- $warehouseCmt : mixed
Return values
array<string|int, mixed>onProductPriceChange()
public
onProductPriceChange(ProductPriceChangedEvent $event) : mixed
Parameters
- $event : ProductPriceChangedEvent
Tags
productStockMailAlert()
Stock alert email
public
productStockMailAlert(mixed $product, mixed $newdate, mixed $oldDate) : int
Parameters
- $product : mixed
- $newdate : mixed
- $oldDate : mixed
Return values
intremove()
public
remove(Product $product) : mixed
Parameters
- $product : Product
Tags
removeOldCategoryFromProduct()
public
removeOldCategoryFromProduct(mixed $id, mixed $oldCat) : mixed
Parameters
- $id : mixed
- $oldCat : mixed
Tags
save()
Save a Product
public
save(Product $product) : Product
Parameters
- $product : Product
Tags
Return values
ProductsaveFromApi()
Saving product information from menzzo API
public
saveFromApi(mixed $datas[, mixed $isV2Data = false ][, mixed $source = 'Menzzo' ]) : bool
Parameters
- $datas : mixed
- $isV2Data : mixed = false
- $source : mixed = 'Menzzo'
Tags
Return values
boolsearchAlertNoCmd()
public
searchAlertNoCmd(mixed $data[, mixed $page = 0 ][, mixed $max = null ][, mixed $getResult = true ]) : mixed
Parameters
- $data : mixed
- $page : mixed = 0
- $max : mixed = null
- $getResult : mixed = true
searchEmplacement()
public
searchEmplacement(mixed $data[, int $page = 0 ][, null $max = null ][, bool $getResult = true ]) : Paginator|mixed
Parameters
- $data : mixed
- $page : int = 0
- $max : null = null
- $getResult : bool = true
Return values
Paginator|mixedsearchEndOfPoductStock()
public
searchEndOfPoductStock(mixed $data[, int $page = 0 ][, null $max = null ][, bool $getResult = true ]) : Paginator|int|mixed|string
Parameters
- $data : mixed
- $page : int = 0
- $max : null = null
- $getResult : bool = true
Return values
Paginator|int|mixed|stringsearchPoductDictionaries()
public
searchPoductDictionaries(mixed $data[, mixed $page = 0 ][, mixed $max = null ][, mixed $getResult = true ]) : mixed
Parameters
- $data : mixed
- $page : mixed = 0
- $max : mixed = null
- $getResult : mixed = true
searchProductPrice()
public
searchProductPrice(mixed $data[, mixed $page = 0 ][, mixed $max = null ][, mixed $getResult = true ]) : mixed
Parameters
- $data : mixed
- $page : mixed = 0
- $max : mixed = null
- $getResult : mixed = true
searchProductPurchases()
search a Sales purchases
public
searchProductPurchases(mixed $data[, int $page = 0 ][, null $max = null ][, bool $getResult = true ]) : mixed
Parameters
- $data : mixed
- $page : int = 0
- $max : null = null
- $getResult : bool = true
Tags
searchProductStock()
Search a product stock
public
searchProductStock(mixed $data[, mixed $page = 0 ][, mixed $max = null ][, mixed $getResult = true ]) : mixed
Parameters
- $data : mixed
- $page : mixed = 0
- $max : mixed = null
- $getResult : mixed = true
Tags
sendWarehouseDataToRabbitMQ()
Envoie les données de stock entrepôt vers RabbitMQ
public
sendWarehouseDataToRabbitMQ(array<string|int, mixed> $product, string $warehouseAvailability, string $customAttribute) : void
Parameters
- $product : array<string|int, mixed>
- $warehouseAvailability : string
- $customAttribute : string
setEntityManager()
Setter of the Entity Manager
public
setEntityManager(EntityManager $em) : mixed
Parameters
- $em : EntityManager
-
the Entity Manager
simulateNewPriceFromBaseOfCalculation()
public
simulateNewPriceFromBaseOfCalculation(mixed $id, mixed $maxPrice, mixed $priceMaxFrom, mixed $maxPriceTo, mixed $specialPrice, mixed $specialPriceFrom, mixed $specialPriceTo, mixed $priceTag) : void
Parameters
- $id : mixed
- $maxPrice : mixed
- $priceMaxFrom : mixed
- $maxPriceTo : mixed
- $specialPrice : mixed
- $specialPriceFrom : mixed
- $specialPriceTo : mixed
- $priceTag : mixed
updateAsirProductStatus()
Update ASIR Product status
public
updateAsirProductStatus(int|Product $productId, int $status) : array<string|int, mixed>|bool|string|JsonResponse
Parameters
- $productId : int|Product
- $status : int
Tags
Return values
array<string|int, mixed>|bool|string|JsonResponseupdateProductDispo()
$availability needs to in format format Y-m-d
public
updateProductDispo(Product $product, mixed $availability) : mixed
Parameters
- $product : Product
- $availability : mixed
updateProductInStore()
public
updateProductInStore(Product $product, mixed $data[, null $storeId = 0 ][, mixed $inputType = 'decimal' ]) : Product
Parameters
- $product : Product
- $data : mixed
- $storeId : null = 0
- $inputType : mixed = 'decimal'
Return values
ProductupdateProductQty()
Update Product Qty
public
updateProductQty(Product $product, mixed $newQty, mixed $user[, bool $updateInMagento = true ][, string $logMessage = 'Mise à jour de la quantité du produit' ]) : string
Parameters
- $product : Product
- $newQty : mixed
- $user : mixed
- $updateInMagento : bool = true
- $logMessage : string = 'Mise à jour de la quantité du produit'
Tags
Return values
stringupdateProductStatus()
Update Product status
public
updateProductStatus(int|Product $productId, int $status[, mixed $newQty = null ][, mixed $productCompositionVerified = false ]) : array<string|int, mixed>|bool|string|JsonResponse
Parameters
- $productId : int|Product
- $status : int
- $newQty : mixed = null
- $productCompositionVerified : mixed = false
Tags
Return values
array<string|int, mixed>|bool|string|JsonResponseupdateWarehouseProductsQty()
public
updateWarehouseProductsQty(int $productId, int $warehouseId, int $warehouseQty, User $user, string $warehouseCmt) : array<string|int, mixed>
Parameters
- $productId : int
- $warehouseId : int
- $warehouseQty : int
- $user : User
- $warehouseCmt : string
Tags
Return values
array<string|int, mixed>activateProductCompositionChilds()
private
activateProductCompositionChilds(mixed $product) : bool
Parameters
- $product : mixed
Return values
boolcalculateProductTotalQyt()
private
calculateProductTotalQyt(Product $product) : int
Parameters
- $product : Product
Tags
Return values
intdesactivateProductCompositionChilds()
Deactivates all child products associated with the given product by updating their status.
private
desactivateProductCompositionChilds(Product $product) : bool
Parameters
- $product : Product
-
The parent product whose child products need to be deactivated.
Return values
bool —True if all child products were successfully deactivated, false otherwise.
exportCsv()
Exporting as csv
private
exportCsv(mixed $data, mixed $columns, mixed $title) : mixed
Parameters
- $data : mixed
- $columns : mixed
- $title : mixed
exportPDF()
Exporting as csv
private
exportPDF(mixed $data, mixed $columns, mixed $title) : mixed
Parameters
- $data : mixed
- $columns : mixed
- $title : mixed
getCompositProductsParentsInfos()
Retrieves information about parent products based on the provided composition items.
private
getCompositProductsParentsInfos(array<string|int, mixed> $compositionItems) : array<string|int, mixed>
Parameters
- $compositionItems : array<string|int, mixed>
-
An array of product SKUs to fetch parent product information for.
Return values
array<string|int, mixed> —An associative array where the keys are product SKUs and the values are arrays containing information about the parent products, such as their activation status.
getProductIdParent()
Get product id parent
private
getProductIdParent(mixed $productData, mixed $relatedProductIds) : string
Parameters
- $productData : mixed
- $relatedProductIds : mixed
Return values
stringgetProductImage()
Get product image from data
private
getProductImage(mixed $productData) : string
Parameters
- $productData : mixed
Return values
stringisStatusUpdateAllowed()
Determines if a status update is allowed based on the provided composite product information and status.
private
isStatusUpdateAllowed(array<string|int, mixed> $compositeProductsInfos, int $status) : bool
Parameters
- $compositeProductsInfos : array<string|int, mixed>
-
An array of composite product information, with each entry containing a key 'is_active' indicating the product's active state.
- $status : int
-
The status indicating the condition for allowing updates. A specific value of 1 has additional validation logic.
Return values
bool —Returns true if the status update is allowed, false otherwise.
logWarehouseProductQty()
private
logWarehouseProductQty(mixed $productWarehouse, mixed $product, mixed $user, mixed $warehouseQty, mixed $oldQty, mixed $newQty, mixed $warehouseCmt, mixed $action) : void
Parameters
- $productWarehouse : mixed
- $product : mixed
- $user : mixed
- $warehouseQty : mixed
- $oldQty : mixed
- $newQty : mixed
- $warehouseCmt : mixed
- $action : mixed
processProductComposition()
Processes the composition of a product, validating its components and performing necessary actions based on the given status.
private
processProductComposition(mixed $product, int $status) : bool
Parameters
- $product : mixed
-
The product object to process. It should have a method to retrieve the composition.
- $status : int
-
The status value used to determine the operation to execute on the product and its composition.
Return values
bool —Returns true if the product composition is successfully processed or if no updates are required.