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
stringThe name of the values
mixedThe value to compare to
arrayThe results to add to
arrayThe answers to compare to
booleanTrue when the value changed.averageInt(array $tokenAnswers, mixed $fieldNames) : float
arrayArray containing the answers
mixedAn array of those names that should be used or a string that should occur in all names that have to be selected.
floatcheckFloatChanged(array $values, array $tokenAnswers) : array
array
array
arrayThose values that were changed.checkIntegerChanged(array $values, array $tokenAnswers) : array
array
array
arrayThose 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
integerroundFixed(\numeric $value, integer $decimals = 2) : string
\numeric
integer
stringsumInt(array $tokenAnswers, mixed $fieldNames) : integer
arrayArray containing the answers
mixedAn 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