package Gems
subpackage Tracker_Model
copyright Copyright (c) 2014 Erasmus MC
license New BSD License
since Class available since version 1.6.3 13-feb-2014 16:33:25

 Methods

__construct()

__construct(\Gems_Loader; $loader, \Gems\Tracker\Engine\FieldsDefinition; $fieldsDefinition, $respTrackIdField = false

Parameters

$loader

\Gems_Loader;

$fieldsDefinition

\Gems\Tracker\Engine\FieldsDefinition;

$respTrackIdField

Overwrite the default field that contains the respondent track id (gr2t_id_respondent_track)

If the transformer add's fields, these should be returned here.

getFieldInfo(\MUtil_Model_ModelAbstract $model) : array

Called in $model->AddTransformer(), so the transformer MUST know which fields to add by then (optionally using the model for that).

Parameters

$model

\MUtil_Model_ModelAbstract

The parent model

Returns

arrayOf filedname => set() values

The transform function performs the actual transformation of the data and is called after the loading of the data in the source model.

transformLoad(\MUtil_Model_ModelAbstract $model, array $data, boolean $new = false, boolean $isPostData = false) : array

Parameters

$model

\MUtil_Model_ModelAbstract

The parent model

$data

array

Nested array

$new

boolean

True when loading a new item

$isPostData

boolean

With post data, unselected multiOptions values are not set so should be added

Returns

arrayNested array containing (optionally) transformed data

This transform function performs the actual save (if any) of the transformer data and is called after the saving of the data in the source model.

transformRowAfterSave(\MUtil_Model_ModelAbstract $model, array $row) : array

Parameters

$model

\MUtil_Model_ModelAbstract

The parent model

$row

array

Array containing row

Returns

arrayRow array containing (optionally) transformed data

This transform function is called before the saving of the data in the source model and allows you to change all data.

transformRowBeforeSave(\MUtil_Model_ModelAbstract $model, array $row) : array

Parameters

$model

\MUtil_Model_ModelAbstract

The parent model

$row

array

Array containing row

Returns

arrayRow array containing (optionally) transformed data

When true, the on save functions are triggered before passing the data on

triggerOnSaves() : boolean

Returns

boolean

 Properties

 

$fieldsDefinition

$fieldsDefinition : \Gems\Tracker\Engine\FieldsDefinition;

Default

 

$loader

$loader : \Gems_loader

Default

 

The field that contains the respondent track id

$respTrackIdField : string

Default

'gr2t_id_respondent_track'