ProductsQuantityUpdateService
in package
implements
LoggerAwareInterface
Updates product quantities.
This class does not use ProductReadService and ProductWriteService due to performance issues.
Interfaces, Classes and Traits
- LoggerAwareInterface
Table of Contents
- $db : CI_DB_query_builder
- $logger : LoggerInterface
- $result_array : mixed
- __construct() : mixed
- setLogger() : mixed
- updateProductQuantities() : void
- Uses a set of AfterbuyProducts to update local product quantities.
- findProductsIdsByModel() : array<string|int, mixed>
- isValidProductsId() : bool
- log() : void
- productHasAttributes() : bool
- productHasProperties() : bool
- setProductQuantity() : mixed
Properties
$db
protected
CI_DB_query_builder
$db
$logger
private
LoggerInterface
$logger
$result_array
private
mixed
$result_array
Methods
__construct()
public
__construct(CI_DB_query_builder $db) : mixed
Parameters
- $db : CI_DB_query_builder
Return values
mixed —setLogger()
public
setLogger(LoggerInterface $logger) : mixed
Parameters
- $logger : LoggerInterface
Return values
mixed —updateProductQuantities()
Uses a set of AfterbuyProducts to update local product quantities.
public
updateProductQuantities([string $mode = 'pid_ean' ], AfterbuyProduct ...$products) : void
Uses the EAN (External Article Number) from Afterbuy to identify local products by their products_id.
Parameters
- $mode : string = 'pid_ean'
- $products : AfterbuyProduct
Return values
void —findProductsIdsByModel()
protected
findProductsIdsByModel(string $model) : array<string|int, mixed>
Parameters
- $model : string
Return values
array<string|int, mixed> —isValidProductsId()
protected
isValidProductsId(int $productsId) : bool
Parameters
- $productsId : int
Return values
bool —log()
protected
log(string $message) : void
Parameters
- $message : string
Return values
void —productHasAttributes()
protected
productHasAttributes(int $productsId) : bool
Parameters
- $productsId : int
Return values
bool —productHasProperties()
protected
productHasProperties(int $productsId) : bool
Parameters
- $productsId : int
Return values
bool —setProductQuantity()
protected
setProductQuantity(int $productsId, float $quantity) : mixed
Parameters
- $productsId : int
- $quantity : float