ProductInfo
FinalYes
Table of Contents
Methods
- __construct() : mixed
- getPrice() : float
- Return float value of product price <br>if price was initialized by <b>setPrice</b> method, it returns it <br>otherwise it will try to initialize a base price of a product. On failure, it will return 0
- getProductId() : int
- getQuantity() : float
- initBasePrice() : void
- Initialize base prices of products with id <b>$productId</b> in base currency
- setPrice() : void
- Set price of product.
Methods
__construct()
public
__construct(int $productId, float $quantity) : mixed
Parameters
- $productId : int
- $quantity : float
getPrice()
Return float value of product price <br>if price was initialized by <b>setPrice</b> method, it returns it <br>otherwise it will try to initialize a base price of a product. On failure, it will return 0
public
getPrice() : float
Return values
floatgetProductId()
public
getProductId() : int
Return values
intgetQuantity()
public
getQuantity() : float
Return values
floatinitBasePrice()
Initialize base prices of products with id <b>$productId</b> in base currency
public
static initBasePrice(int ...$productId) : void
Parameters
- $productId : int
-
ids of products
Tags
setPrice()
Set price of product.
public
static setPrice(int $productId, float $productPrice) : void
Use it if you need to set up a custom price of product.
Parameters
- $productId : int
- $productPrice : float