Warning: mysql_connect(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /home/zurmoorg/public_html/z-header.php on line 8

Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/zurmoorg/public_html/z-header.php on line 8

CalculatedNumberUtil Class Reference

Static Public Member Functions

static calculateByFormulaAndModelAndResolveFormat ($formula, RedBeanModel $model)
static calculateByFormulaAndModel ($formula, RedBeanModel $model, &$formatType, &$currencyCode)
static isFormulaValid ($formula, $modelClassName)

Data Fields

const FORMAT_TYPE_INTEGER = 1
const FORMAT_TYPE_DECIMAL = 2
const FORMAT_TYPE_CURRENCY_VALUE = 3

Static Protected Member Functions

static calculateByExpressionAndModel ($expression, RedBeanModel $model, &$formatType, &$currencyCode)
static getIfStatementParts ($formula)
static getConditionParts ($condition)
static isExpressionValid ($expression, $modelClassName)
static isString ($expression)
static isAttribute ($expression, $modelClassName)
static isConditionValid ($condition, $modelClassName)
static isIfStatementValid ($condition, $trueExpression, $falseExpression, $modelClassName)
static mathEval ($equation)
static resolveFormatTypeAndCurrencyCode (&$formatType, &$currencyCode, $model, $attribute)

Detailed Description

Helper class to work with calculated numbers.

Definition at line 40 of file CalculatedNumberUtil.php.


Member Function Documentation

static calculateByFormulaAndModelAndResolveFormat ( formula,
RedBeanModel model 
) [static]

Calculate the formula and resolve the correct formula based on the attributes included in the formula

Parameters:
$formula 
RedBeanModel $model
Returns:
mixed
Exceptions:
NotSupportedException 

Definition at line 55 of file CalculatedNumberUtil.php.

static calculateByFormulaAndModel ( formula,
RedBeanModel model,
&$  formatType,
&$  currencyCode 
) [static]

Given a formula string and a model, calculate the number using the formula and values from the attributes on the model.

Parameters:
string $formula
RedBeanModel $model
$formatType 
$currencyCode 
Returns:
bool|int|string calculated value as number.

Definition at line 91 of file CalculatedNumberUtil.php.

static isFormulaValid ( formula,
modelClassName 
) [static]

Given a formula string and a model, determine if the formula is correctly formed and is using valid attributes from the given model.

Parameters:
$formula 
$modelClassName 
Returns:
bool

Definition at line 205 of file CalculatedNumberUtil.php.


The documentation for this class was generated from the following file:
 All Data Structures Functions Variables
Generated on Wed Jan 23 07:10:22 2019

Warning: mysql_connect(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /home/zurmoorg/public_html/z-footer.php on line 8

Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/zurmoorg/public_html/z-footer.php on line 8