PriceList
Price list table trait
Table of Contents
Methods
- createPrice() : Model|false
- Create price
- getPrice() : Model|null
- Get price
- hasPrice() : bool
- Return true if price exist
- savePrice() : mixed
- Save price
- scopePriceQuery() : Builder
- Get price list query
Methods
createPrice()
Create price
public
createPrice(int $productId, string $key, float $price[, string|null|int $currency = null ]) : Model|false
Parameters
- $productId : int
- $key : string
- $price : float
- $currency : string|null|int = null
Return values
Model|falsegetPrice()
Get price
public
getPrice(int $productId[, string $key = null ][, string|int|null $currency = null ]) : Model|null
Parameters
- $productId : int
- $key : string = null
- $currency : string|int|null = null
Return values
Model|nullhasPrice()
Return true if price exist
public
hasPrice(int $productId[, string|null $key = null ][, string|int|null $currency = null ]) : bool
Parameters
- $productId : int
- $key : string|null = null
- $currency : string|int|null = null
Return values
boolsavePrice()
Save price
public
savePrice(int $productId, float $price[, string|null $key = null ][, string|null $currency = null ]) : mixed
Parameters
- $productId : int
- $price : float
- $key : string|null = null
- $currency : string|null = null
scopePriceQuery()
Get price list query
public
scopePriceQuery(mixed $query, int $productId[, string|null $key = null ][, string|null $currency = null ]) : Builder
Parameters
- $query : mixed
- $productId : int
- $key : string|null = null
- $currency : string|null = null