Shop_Controller
in package
Online shop.
Tags
Table of Contents
Properties
- $instance : mixed
- The singleton instances.
- $_bankersRoundHalfToEven : bool
- Banker's Round half to even TRUE - Round half to even. 23.5 => 24, 24.5 => 24 FALSE - Round half to odd. 23.5 => 23, 24.5 => 25
- $_bankersRounding : bool
- Use Banker's Rounding. Default TRUE
- $_decimalDigits : int
- Number of decimal digits
- $_floatFormat : string
- Float digits format
Methods
- bankersRoundHalfToEven() : self
- Banker's Round half to even TRUE - Round half to even. 23.5 => 24, 24.5 => 24 FALSE - Round half to odd. 23.5 => 23, 24.5 => 25
- bankersRounding() : self
- Use Banker's Rounding
- bRound() : float
- Banker's Round depends on $this->_bankersRoundHalfToEven
- convertDecimal() : mixed
- Convert decimal
- convertFloat() : mixed
- Convert decimal
- convertPrice() : mixed
- Convert price
- convertSizeMeasure() : mixed
- Конвертирование значения из одной меры размера в другую
- decimalDigits() : self
- Set number of decimal digits
- fillCurrencies() : array<string|int, mixed>
- Get currencies for list
- fillMeasures() : array<string|int, mixed>
- Get measures for list
- fillShops() : array<string|int, mixed>
- Get shops for list
- floatFormat() : self
- Set float format
- getCurrencyCoefficientInShopCurrency() : float
- Определение коэффициента пересчета валюты $oItem_Currency в валюту $oShop_Currency
- getDocument() : object|null
- Get document
- getDocumentId() : int
- Get uniq document ID
- getDocumentModel() : mixed
- Get Model Name By Type Id
- getDocumentType() : int|null
- Get document type
- instance() : object
- Register an existing instance as a singleton.
- round() : string
- Округление цен к формату, приведенного в $this->_floatFormat
- showGroupButton() : mixed
- showItemButton() : mixed
- showRootButton() : mixed
Properties
$instance
The singleton instances.
public
static mixed
$instance
= \NULL
$_bankersRoundHalfToEven
Banker's Round half to even TRUE - Round half to even. 23.5 => 24, 24.5 => 24 FALSE - Round half to odd. 23.5 => 23, 24.5 => 25
protected
bool
$_bankersRoundHalfToEven
= \TRUE
$_bankersRounding
Use Banker's Rounding. Default TRUE
protected
bool
$_bankersRounding
= \TRUE
$_decimalDigits
Number of decimal digits
protected
int
$_decimalDigits
= 2
$_floatFormat
Float digits format
protected
string
$_floatFormat
= "%.2f"
Methods
bankersRoundHalfToEven()
Banker's Round half to even TRUE - Round half to even. 23.5 => 24, 24.5 => 24 FALSE - Round half to odd. 23.5 => 23, 24.5 => 25
public
bankersRoundHalfToEven([bool $bankersRoundHalfToEven = TRUE ]) : self
Parameters
- $bankersRoundHalfToEven : bool = TRUE
Return values
selfbankersRounding()
Use Banker's Rounding
public
bankersRounding([bool $bankersRounding = TRUE ]) : self
Parameters
- $bankersRounding : bool = TRUE
Return values
selfbRound()
Banker's Round depends on $this->_bankersRoundHalfToEven
public
bRound(float $value[, int $precision = 0 ]) : float
Parameters
- $value : float
-
The value to round
- $precision : int = 0
-
The optional number of decimal digits to round to
Return values
float —The rounded value
convertDecimal()
Convert decimal
public
static convertDecimal(mixed $value) : mixed
Parameters
- $value : mixed
convertFloat()
Convert decimal
public
convertFloat(mixed $value) : mixed
Parameters
- $value : mixed
convertPrice()
Convert price
public
convertPrice(mixed $price[, int $decimalDigits = NULL ]) : mixed
Parameters
- $price : mixed
-
price
- $decimalDigits : int = NULL
-
e.g. 2, default uses $this->_decimalDigits
convertSizeMeasure()
Конвертирование значения из одной меры размера в другую
public
static convertSizeMeasure(string $value, int $sourceMeasure[, int $destMeasure = 0 ]) : mixed
Parameters
- $value : string
-
значение для конвертации
- $sourceMeasure : int
-
исходная мера
- $destMeasure : int = 0
-
целевая мера
decimalDigits()
Set number of decimal digits
public
decimalDigits(mixed $decimalDigits) : self
Parameters
- $decimalDigits : mixed
Return values
selffillCurrencies()
Get currencies for list
public
static fillCurrencies() : array<string|int, mixed>
Return values
array<string|int, mixed>fillMeasures()
Get measures for list
public
static fillMeasures() : array<string|int, mixed>
Return values
array<string|int, mixed>fillShops()
Get shops for list
public
static fillShops(int $iSiteId) : array<string|int, mixed>
Parameters
- $iSiteId : int
-
site ID
Return values
array<string|int, mixed>floatFormat()
Set float format
public
floatFormat(string $floatFormat) : self
Parameters
- $floatFormat : string
-
format
Return values
selfgetCurrencyCoefficientInShopCurrency()
Определение коэффициента пересчета валюты $oItem_Currency в валюту $oShop_Currency
public
getCurrencyCoefficientInShopCurrency(Shop_Currency_Model $oItem_Currency, Shop_Currency_Model $oShop_Currency) : float
Parameters
- $oItem_Currency : Shop_Currency_Model
-
исходная валюта
- $oShop_Currency : Shop_Currency_Model
-
требуемая валюта
Return values
floatgetDocument()
Get document
public
static getDocument(mixed $document_id) : object|null
Parameters
- $document_id : mixed
Return values
object|nullgetDocumentId()
Get uniq document ID
public
static getDocumentId(int $id, int $type) : int
Parameters
- $id : int
-
document ID
- $type : int
-
document type
Return values
intgetDocumentModel()
Get Model Name By Type Id
public
static getDocumentModel(int $type) : mixed
Parameters
- $type : int
getDocumentType()
Get document type
public
static getDocumentType(mixed $document_id) : int|null
Parameters
- $document_id : mixed
Return values
int|nullinstance()
Register an existing instance as a singleton.
public
static instance() : object
Return values
objectround()
Округление цен к формату, приведенного в $this->_floatFormat
public
round(float $value) : string
Parameters
- $value : float
-
цена
Return values
stringshowGroupButton()
public
static showGroupButton() : mixed
showItemButton()
public
static showItemButton() : mixed
showRootButton()
public
static showRootButton() : mixed