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:43:37 |
inherited_from |
\Gems\Tracker\Field\DateField |
Methods
__construct()
__construct(integer $trackId, string $key, array $fieldDefinition)
Inherited
inherited_from |
\Gems\Tracker\Field\FieldInterface::__construct() |
Parameters
$trackId
integer
gems__tracks id for this field
$fieldDefinition
array
Field definition array
Calculation the field info display for this type
calculateFieldInfo(array $currentValue, array $fieldData) : mixed
Inherited
inherited_from |
\Gems\Tracker\Field\FieldInterface::calculateFieldInfo() |
Parameters
$currentValue
array
The current value
$fieldData
array
The other values loaded so far
Returns
mixed
the new value
Calculate the field value using the current values
calculateFieldValue(array $currentValue, array $fieldData, array $trackData) : mixed
Inherited
inherited_from |
\Gems\Tracker\Field\FieldInterface::calculateFieldValue() |
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
mixed
the new value
Signal the start of a new calculation round (for all fields)
calculationStart(array $trackData) : \Gems\Tracker\Field\FieldAbstract
Inherited
inherited_from |
\Gems\Tracker\Field\FieldInterface::calculationStart() |
Parameters
$trackData
array
The currently available track data (track id may be empty)
Returns
\Gems\Tracker\Field\FieldAbstract
Get the fields that should be used for calculation,
first field to use first.
getCalculationFields(array $fieldData) : array
Inherited
I.e. the last selected field in field maintenance
is the first field in the output array.
Parameters
$fieldData
array
The fields being saved
Returns
array
[fieldKey => fieldValue]
On save calculation function
getCode() : string
Inherited
inherited_from |
\Gems\Tracker\Field\FieldInterface::getCode() |
Returns
string
The field code
Respondent track fields that this field's settings are dependent on.
getDataModelDependsOn() : array
Inherited
inherited_from |
\Gems\Tracker\Field\FieldInterface::getDataModelDependsOn() |
Returns
array
Null 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
Inherited
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.
inherited_from |
\Gems\Tracker\Field\FieldInterface::getDataModelDependyChanges() |
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
Inherited
inherited_from |
\Gems\Tracker\Field\FieldInterface::getDataModelEffecteds() |
Returns
array
Null or an array of model settings that change for this field
getDataModelSettings()
getDataModelSettings() : array
Inherited
inherited_from |
\Gems\Tracker\Field\FieldInterface::getDataModelSettings() |
Returns
array
Of settings to add to a model using these fields
getFieldId()
getFieldId() : integer
Inherited
inherited_from |
\Gems\Tracker\Field\FieldInterface::getFieldId() |
Returns
integer
The track field id
getFieldKey()
getFieldKey() : string
Inherited
inherited_from |
\Gems\Tracker\Field\FieldInterface::getFieldKey() |
Returns
string
The track field key as used by the union model
getFieldSub()
getFieldSub() : string
Inherited
inherited_from |
\Gems\Tracker\Field\FieldInterface::getFieldSub() |
Returns
string
The track field sub (model) value
getFieldType()
getFieldType() : string
Inherited
inherited_from |
\Gems\Tracker\Field\FieldInterface::getFieldType() |
Returns
string
The field type
getLabel()
getLabel() : string
Inherited
inherited_from |
\Gems\Tracker\Field\FieldInterface::getLabel() |
Returns
string
The field label
getOrder()
getOrder() : integer
Inherited
inherited_from |
\Gems\Tracker\Field\FieldInterface::getOrder() |
Returns
integer
The field order
hasDataModelDependencies()
hasDataModelDependencies() : boolean
Inherited
inherited_from |
\Gems\Tracker\Field\FieldInterface::hasDataModelDependencies() |
Returns
boolean
When this field has dependencies
Should the label be included in the track information?
isLabelInTrackInfo() : boolean
Inherited
inherited_from |
\Gems\Tracker\Field\FieldInterface::isLabelInTrackInfo() |
Returns
boolean
isReadOnly()
isReadOnly() : boolean
Inherited
Returns
boolean
True when this field is read only
Calculation the field value when loading from a respondent track
onFieldDataLoad(array $currentValue, array $fieldData) : mixed
Inherited
inherited_from |
\Gems\Tracker\Field\FieldInterface::onFieldDataLoad() |
Parameters
$currentValue
array
The current value
$fieldData
array
The other values loaded so far
Returns
mixed
the new value
Converting the field value when saving to a respondent track
onFieldDataSave(array $currentValue, array $fieldData) : mixed
Inherited
inherited_from |
\Gems\Tracker\Field\FieldInterface::onFieldDataSave() |
Parameters
$currentValue
array
The current value
$fieldData
array
The other values loaded so far
Returns
mixed
the new value
Should this field be added to the track info
toTrackInfo() : boolean
Inherited
inherited_from |
\Gems\Tracker\Field\FieldInterface::toTrackInfo() |
Returns
boolean
Add the model settings like the elementClass for this field.
addModelSettings(array $settings)
Inherited
elementClass is overwritten when this field is read only, unless you override it again in getDataModelSettings()
Parameters
$settings
array
The settings set so far
Properties
Respondent track fields that this field's settings are dependent on.
$_dependsOn : array
Model settings for this field that may change depending on the dependsOn fields.
$_effecteds : array
Field definition array
$_fieldDefinition : array
$_fieldKey
$_fieldKey : string
gems__tracks id for this field
$_trackId : integer
$loader
$loader : \Gems_Loader
Constants
Option seperator for fields
FIELD_SEP = '|'