StoreWithProductsInfo extends StoreInfo
Table of Contents
Methods
- __construct() : mixed
- addProduct() : void
- Add product to storage instance or summarize quantity if it exists
- getCalculatedSumPrice() : float
- Return sum of price * amount of all products in StoreInfo
- getProductList() : array<string|int, mixed>
- Return array of <b>ProductInfo</b> instances
- getStoreId() : int
- getStoreName() : string
- Return name of store <br>if name was already loaded by <b>loadStoreName</b> method, it returns it <br>otherwise it will load name throw <b>loadStoreName</b> and returns it
- loadStoreName() : void
- Load stores names with <b>$storeIds</b> id
- setStoreName() : void
Methods
__construct()
public
__construct(int $storeId) : mixed
Parameters
- $storeId : int
addProduct()
Add product to storage instance or summarize quantity if it exists
public
addProduct(ProductInfo ...$product) : void
Parameters
- $product : ProductInfo
getCalculatedSumPrice()
Return sum of price * amount of all products in StoreInfo
public
getCalculatedSumPrice() : float
Return values
floatgetProductList()
Return array of <b>ProductInfo</b> instances
public
getProductList() : array<string|int, mixed>
Return values
array<string|int, mixed>getStoreId()
public
getStoreId() : int
Return values
intgetStoreName()
Return name of store <br>if name was already loaded by <b>loadStoreName</b> method, it returns it <br>otherwise it will load name throw <b>loadStoreName</b> and returns it
public
getStoreName() : string
Return values
stringloadStoreName()
Load stores names with <b>$storeIds</b> id
public
static loadStoreName(int ...$storeIds) : void
Parameters
- $storeIds : int
Tags
setStoreName()
public
static setStoreName(int $storeId, string $storeName) : void
Parameters
- $storeId : int
- $storeName : string