package Gems
subpackage Tracker
copyright Copyright (c) 2011 Erasmus MC
license New BSD License
since Class available since version 1.4

 Methods

__construct()

__construct(array $trackData) 

Parameters

$trackData

array

array containing track record

Integrate field loading en showing and editing

addFieldsToModel(\MUtil_Model_ModelAbstract $model, boolean $addDependency = true) : \Gems_Tracker_Engine_TrackEngineAbstract

Parameters

$model

\MUtil_Model_ModelAbstract

$addDependency

boolean

True when editing, can be false in all other cases

Returns

\Gems_Tracker_Engine_TrackEngineAbstract

Set menu parameters from this track engine

applyToMenuSource(\Gems_Menu_ParameterSource $source) : \Gems_Tracker_Engine_TrackEngineInterface

Parameters

$source

\Gems_Menu_ParameterSource

Returns

\Gems_Tracker_Engine_TrackEngineInterface(continuation pattern)

Calculate the track info from the fields

calculateFieldsInfo(array $data) : string

Parameters

$data

array

The values to save

Returns

stringThe description to save as track_info

Calculate the number of active rounds in this track from the database.

calculateRoundCount() : integer

Returns

integerThe number of rounds in this track.

Check for the existence of all tokens and create them otherwise

checkRoundsFor(\Gems_Tracker_RespondentTrack $respTrack, integer $userId, \Gems_Task_TaskRunnerBatch $batch = null

Parameters

$respTrack

\Gems_Tracker_RespondentTrack

The respondent track to check

$userId

integer

Id of the user who takes the action (for logging)

$batch

Check the valid from and until dates in the track starting at a specified token

checkTokensFrom(\Gems_Tracker_RespondentTrack $respTrack, \Gems_Tracker_Token $startToken, integer $userId, \Gems_Tracker_Token $skipToken = null) : integer

Parameters

$respTrack

\Gems_Tracker_RespondentTrack

The respondent track to check

$startToken

\Gems_Tracker_Token

The token to start at

$userId

integer

Id of the user who takes the action (for logging)

$skipToken

\Gems_Tracker_Token

Optional token to skip in the recalculation

Returns

integerThe number of tokens changed by this code

Check the valid from and until dates in the track

checkTokensFromStart(\Gems_Tracker_RespondentTrack $respTrack, integer $userId) : \Gems_Tracker_ChangeTracker

Parameters

$respTrack

\Gems_Tracker_RespondentTrack

The respondent track to check

$userId

integer

Id of the user who takes the action (for logging)

Returns

\Gems_Tracker_ChangeTrackerdetailed info on changes

Convert a TrackEngine instance to a TrackEngine of another type.

convertTo(\type $conversionTargetClass) 
see

Parameters

$conversionTargetClass

\type

Copy a track and all it's related data (rounds/fields etc)

copyTrack(\inte $oldTrackId) : integer

Parameters

$oldTrackId

\inte

The id of the track to copy

Returns

integerThe id of the copied track

An array of snippet names for displaying the answers to a survey.

getAnswerSnippetNames() : array

Returns

arrayif string snippet names

Returns a list of classnames this track engine can be converted into.

getConversionTargets(array $options) : array

Should always contain at least the class itself.

see

Parameters

$options

array

The track engine class options available in as a "track engine class names" => "descriptions" array

Returns

arrayFilter or adaptation of $options

A longer description of the workings of the engine.

getDescription() : string

Engine level function, should be the same for each class instance.

Returns

stringName

Returns an array of the fields in this track key / value are id / field name

getFieldNames() : array

Returns

arrayfieldid => fieldcode

Get the FieldUpdateEvent for this trackId

getFieldUpdateEvent() : \Gems_TrackFieldUpdateEventInterface

Returns

\Gems_TrackFieldUpdateEventInterface| null

Returns the field data for the respondent track id.

getFieldsData(integer $respTrackId) : array

Parameters

$respTrackId

integer

Gems respondent track id or null when new

Returns

arrayof the existing field values for this respondent track

Get the storage model for field values

getFieldsDataStorageModel() : \Gems\Tracker\Model\FieldDataModel

Returns

\Gems\Tracker\Model\FieldDataModel

Returns the field definition for the track enige.

getFieldsDefinition() : \Gems\Tracker\Engine\FieldsDefinition;

Returns

\Gems\Tracker\Engine\FieldsDefinition;

Returns the fields required for editing a track of this type.

getFieldsMaintenanceModel(boolean $detailed = false, string $action = 'index') : array: \Gems\Tracker\Model\FieldMaintenanceModel

Parameters

$detailed

boolean

Create a model for the display of detailed item data or just a browse table

$action

string

The current action

Returns

arrayof \Zend_Form_Element / public function getFieldsElements(); Returns a model that can be used to retrieve or save the field definitions for the track editor.
\Gems\Tracker\Model\FieldMaintenanceModel

Returns an array name => code of all the fields of the type specified

getFieldsOfType(string $fieldType) : array

Parameters

$fieldType

string

Returns

arrayname => code

Get the round id of the first round

getFirstRoundId() : integer

Returns

integerGems id of first round

A pretty name for use in dropdown selection boxes.

getName() : string

Engine level function, should be the same for each class instance.

Returns

stringName

Look up the round id for the next round

getNextRoundId(integer $roundId) : integer

Parameters

$roundId

integer

Gems round id

Returns

integerGems round id

Look up the round id for the previous round

getPreviousRoundId(integer $roundId, integer $roundOrder = null) : integer

Parameters

$roundId

integer

Gems round id

$roundOrder

integer

Optional extra round order, for when the current round may have changed.

Returns

integerGems round id

Get the round object

getRound(integer $roundId) : \Gems\Tracker\Round

Parameters

$roundId

integer

Gems round id

Returns

\Gems\Tracker\Round

Returns a snippet name that can be used to display the answers to the token or nothing.

getRoundAnswerSnippets(\Gems_Tracker_Token $token) : array

Parameters

$token

\Gems_Tracker_Token

Returns

arrayOf snippet names

Return the Round Changed event name for this round

getRoundChangedEvent(integer $roundId) : \Gems_Event_RoundChangedEventInterface

Parameters

$roundId

integer

Returns

\Gems_Event_RoundChangedEventInterfaceevent instance or null

Get the defaults for a new round

getRoundDefaults() : array

Returns

arrayOf fieldname => default

The round descriptions for this track

getRoundDescriptions() : array

Returns

arrayroundId => string

An array of snippet names for editing a round.

getRoundEditSnippetNames() : array

Returns

arrayof string snippet names

Returns a model that can be used to retrieve or save the data.

getRoundModel(boolean $detailed, string $action) : \Gems_Model_JoinModel

Parameters

$detailed

boolean

Create a model for the display of detailed item data or just a browse table

$action

string

The current action

Returns

\Gems_Model_JoinModel

An array of snippet names for editing a round.

getRoundShowSnippetNames() : array

Returns

arrayof string snippet names

Get all the round objects

getRounds() : array

Returns

arrayof roundId => \Gems\Tracker\Round

An array of snippet names for deleting a token.

getTokenDeleteSnippetNames(\Gems_Tracker_Token $token) : array

Parameters

$token

\Gems_Tracker_Token

Allows token status dependent delete snippets

Returns

arrayof string snippet names

An array of snippet names for editing a token.

getTokenEditSnippetNames(\Gems_Tracker_Token $token) : array

Parameters

$token

\Gems_Tracker_Token

Allows token status dependent edit snippets

Returns

arrayof string snippet names

Returns a model that can be used to save, edit, etc. the token

getTokenModel() : \Gems_Tracker_Model_StandardTokenModel

Returns

\Gems_Tracker_Model_StandardTokenModel

An array of snippet names for displaying a token

getTokenShowSnippetNames(\Gems_Tracker_Token $token) : array

Parameters

$token

\Gems_Tracker_Token

Allows token status dependent show snippets

Returns

arrayof string snippet names

Get the TrackCompletedEvent for the given trackId

getTrackCalculationEvent() : \Gems_Event_TrackCalculationEventInterface

Returns

\Gems_Event_TrackCalculationEventInterface| null

Get the TrackCompletedEvent for the given trackId

getTrackCompletionEvent() : \Gems_Event_TrackCompletedEventInterface | null

Returns

\Gems_Event_TrackCompletedEventInterfacenull

getTrackId()

getTrackId() : integer

Returns

integerThe track id

getTrackName()

getTrackName() : string

Returns

stringThe gems track name

The track type of this engine

getTrackType() : string

Returns

string'T' or 'S'

Is the field an appointment type

isAppointmentField(string $fieldName) : boolean

Parameters

$fieldName

string

Returns

boolean

True if the user can create this kind of track in TrackMaintenanceAction.

isUserCreatable() : boolean

False if this type of track is created by specialized user interface actions.

Engine level function, should be the same for each class instance.

Returns

boolean

Updates the number of rounds in this track.

updateRoundCount(integer $userId) : integer

Parameters

$userId

integer

The current user

Returns

integer1 if data changed, 0 otherwise