package Gems
subpackage Tracker_Field
copyright Copyright (c) 2015 Erasmus MC
license New BSD License
since Class available since version 1.6.5 4-mrt-2015 11:11:42

 Methods

__construct()

__construct(integer $trackId, string $key, array $fieldData) 

Parameters

$trackId

integer

gems__tracks id for this field

$key

string

The field key

$fieldData

Calculation the field info display for this type

calculateFieldInfo(array $currentValue, array $fieldData) : mixed

Parameters

$currentValue

array

The current value

$fieldData

array

The other values loaded so far

Returns

mixedthe new value

Calculate the field value using the current values

calculateFieldValue(array $currentValue, array $fieldData, array $trackData) : mixed

Parameters

$currentValue

array

The current value

$fieldData

array

The other known field values

$trackData

array

The currently available track data (track id may be empty)

Returns

mixedthe new value

Signal the start of a new calculation round (for all fields)

calculationStart(array $trackData) : \Gems\Tracker\Field\FieldAbstract

Parameters

$trackData

array

The currently available track data (track id may be empty)

Returns

\Gems\Tracker\Field\FieldAbstract

On save calculation function

getCode() : mixed: string

Returns

mixedthe new value / public function calculateOnSave($currentValue, array $values, array $fieldData, $respTrackId = null);
stringThe field code

Respondent track fields that this field's settings are dependent on.

getDataModelDependsOn() : array

Returns

arrayNull or an array of respondent track fields

Returns the changes to the model for this field that must be made in an array consisting of

getDataModelDependyChanges(array $context, boolean $new) : array

array(setting1 => $value1, setting2 => $value2, ...),

By using [] array notation in the setting array key you can append to existing values.

Use the setting 'value' to change a value in the original data.

When a 'model' setting is set, the workings cascade.

Parameters

$context

array

The current data this object is dependent on

$new

boolean

True when the item is a new record not yet saved

Returns

array(setting => value)

Model settings for this field that may change depending on the dependsOn fields.

getDataModelEffecteds() : array

Returns

arrayNull or an array of model settings that change for this field

getDataModelSettings()

getDataModelSettings() : array

Returns

arrayOf settings to add to a model using these fields

getFieldId()

getFieldId() : integer

Returns

integerThe track field id

getFieldKey()

getFieldKey() : string

Returns

stringThe track field key as used by the union model

getFieldSub()

getFieldSub() : string

Returns

stringThe track field sub (model) value

getFieldType()

getFieldType() : string

Returns

stringThe field type

getLabel()

getLabel() : string

Returns

stringThe field label

getOrder()

getOrder() : integer

Returns

integerThe field order

hasDataModelDependencies()

hasDataModelDependencies() : boolean

Returns

booleanWhen this field has dependencies

Should the label be included in the track information?

isLabelInTrackInfo() : boolean

Returns

boolean

Calculate the field value using the current values

onFieldDataLoad(array $currentValue, array $fieldData) : mixed

Parameters

$currentValue

array

The current value

$fieldData

array

The other values loaded so far

Returns

mixedthe new value

Converting the field value when saving to a respondent track

onFieldDataSave(array $currentValue, array $fieldData) : mixed

Parameters

$currentValue

array

The current value

$fieldData

array

The other values loaded so far

Returns

mixedthe new value

Should this field be added to the track info

toTrackInfo() : boolean

Returns

boolean