Helper class containing calculation functions for use in event classes.
package | Gems |
---|---|
subpackage | Event |
copyright | Copyright (c) 2011 Erasmus MC |
license | New BSD License |
since | Class available since version 1.4 |
addWhenChanged(string $name, mixed $value, array $results, array $tokenAnswers) : boolean
string
The name of the values
mixed
The value to compare to
array
The results to add to
array
The answers to compare to
boolean
True when the value changed.averageInt(array $tokenAnswers, mixed $fieldNames) : float
array
Array containing the answers
mixed
An array of those names that should be used or a string that should occur in all names that have to be selected.
float
checkFloatChanged(array $values, array $tokenAnswers) : array
array
array
array
Those values that were changed.checkIntegerChanged(array $values, array $tokenAnswers) : array
array
array
array
Those values that were changed.reverseCode(integer $code, integer $min, integer $max) : integer
Used when a code can have the values 1 to 5 or 0 to 9 and the reverse outcome should be used, e.g.: 5 = 1, 4 = 2, 3 = 3, 2 = 4, 1 = 5.
integer
integer
integer
integer
roundFixed(\numeric $value, integer $decimals = 2
) : string
\numeric
integer
string
sumInt(array $tokenAnswers, mixed $fieldNames) : integer
array
Array containing the answers
mixed
An array of those names that should be used or a string that should occur in all names that have to be selected.
integer
_arrayFindName(array $tokenAnswers, string $fieldNames) : array
array
string
array