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

$key

string

The field key

$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

mixedthe 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

mixedthe 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

stringThe field code

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

getDataModelDependsOn() : array
Inherited
inherited_from \Gems\Tracker\Field\FieldInterface::getDataModelDependsOn()

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
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

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

getDataModelSettings()

getDataModelSettings() : array
Inherited
inherited_from \Gems\Tracker\Field\FieldInterface::getDataModelSettings()

Returns

arrayOf settings to add to a model using these fields

getFieldId()

getFieldId() : integer
Inherited
inherited_from \Gems\Tracker\Field\FieldInterface::getFieldId()

Returns

integerThe track field id

getFieldKey()

getFieldKey() : string
Inherited
inherited_from \Gems\Tracker\Field\FieldInterface::getFieldKey()

Returns

stringThe track field key as used by the union model

getFieldSub()

getFieldSub() : string
Inherited
inherited_from \Gems\Tracker\Field\FieldInterface::getFieldSub()

Returns

stringThe track field sub (model) value

getFieldType()

getFieldType() : string
Inherited
inherited_from \Gems\Tracker\Field\FieldInterface::getFieldType()

Returns

stringThe field type

getLabel()

getLabel() : string
Inherited
inherited_from \Gems\Tracker\Field\FieldInterface::getLabel()

Returns

stringThe field label

getOrder()

getOrder() : integer
Inherited
inherited_from \Gems\Tracker\Field\FieldInterface::getOrder()

Returns

integerThe field order

hasDataModelDependencies()

hasDataModelDependencies() : boolean
Inherited
inherited_from \Gems\Tracker\Field\FieldInterface::hasDataModelDependencies()

Returns

booleanWhen 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

booleanTrue 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

mixedthe 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

mixedthe 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

Get the date display format (zend style)

getDateFormat() : string
inherited_from \Gems\Tracker\Field\DateField::getDateFormat()

Returns

string

Get the date display format (zend style)

getDateFormat() : string
Inherited

Returns

string

Get the date display format (zend style)

getStorageFormat() : string
inherited_from \Gems\Tracker\Field\DateField::getStorageFormat()

Returns

string

Get the date display format (zend style)

getStorageFormat() : string
Inherited

Returns

string

 Properties

 

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

$_dependsOn : array

Default

 

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

$_effecteds : array

Default

 

Field definition array

$_fieldDefinition : array

Default

 

$_fieldKey

$_fieldKey : string

Default

 

gems__tracks id for this field

$_trackId : integer

Default

 

$loader

$loader : \Gems_Loader

Default

 

The format string for outputting dates

$phpDateTimeFormat : string

Default

'j M Y H:i:s'
inherited_from \Gems\Tracker\Field\DateField::phpDateTimeFormat
 

The format string for outputting dates

$phpDateTimeFormat : string

Default

'j M Y'
 

The format string for outputting dates

$zendDateTimeFormat : string

Default

'dd MMM yyyy HH:mm:ss'
inherited_from \Gems\Tracker\Field\DateField::zendDateTimeFormat
 

The format string for outputting dates

$zendDateTimeFormat : string

Default

'dd MMM yyyy'

 Constants

 

Option seperator for fields

FIELD_SEP = '|'