The tracker is the central access point doing anything with tracks or tokens.
Tracker contains a number of getXxx functions to create Token, Survey, RespondentTrack, [Survey]SourceInterface and TrackEngine objects.
Tracker also offers \MUtil_Model_ModelAbstract children for RespondentTracks, Surveys, Tokens and Tracks.
Other object classes accessible through gems_Tracker are TokenLibrary (defines how tokens are created and checked), TokenSelect (\Gems_Tracker_Token_TokenSelect extension) and TokenValidator.
Other functions are general utility functions, e.g. checkTrackRounds(), createToken(), processCompletedTokens() and recalculateTokens().
package | Gems |
---|---|
subpackage | Tracker |
copyright | Copyright (c) 2011 Erasmus MC |
license | New BSD License |
since | Class available since version 1.4 |
inherited_from | \Gems_Loader_TargetLoaderAbstract |
__construct(\type $container, array $dirs)
\type
A container acting as source fro \MUtil_Registry_Source
array
The directories where to look for requested classes
__construct(mixed $container, array $dirs)
mixed
A container acting as source for \MUtil_Registry_Source
array
The directories where to look for requested classes
__get($name)
addPrefixPath(string $prefix, $path, boolean $prepend = true
) : \Gems_Loader_LoaderAbstract
string
boolean
Put path at the beginning of the stack (has no effect when prefix / dir already set)
\Gems_Loader_LoaderAbstract
(continuation pattern)addSourceClasses(array $stack)
array
classname / description array of sourceclasses
afterRegistry() : void
answerRegistryRequest(string $name, mixed $resource) : boolean
string
Name of resource to set
mixed
The resource.
boolean
True if $resource was OKcheckRegistryRequestsAnswers() : boolean
boolean
False if required values are missing.checkTrackRounds(string $batchId, integer $userId= null
, string $cond= null
) : \Gems_Task_TaskRunnerBatch
Does recalculate changed tracks
inherited_from | \Gems_Tracker_TrackerInterface::checkTrackRounds() |
---|
string
A unique identifier for the current batch
integer
Id of the user who takes the action (for logging)
string
Optional where statement for selecting tracks
\Gems_Task_TaskRunnerBatch
A batch to process the changescreateRespondentTrack(integer $respondentId, integer $organizationId, integer $trackId, integer $userId, mixed $respTrackData= array()
, array $trackFieldsData= array()
) : \Gems_Tracker_RespondentTrack
inherited_from | \Gems_Tracker_TrackerInterface::createRespondentTrack() |
---|
integer
The real patientId (grs_id_user), not the patientnr (gr2o_patient_nr)
integer
integer
integer
Id of the user who takes the action (for logging)
mixed
Optional array containing field values or the start date.
array
\Gems_Tracker_RespondentTrack
The newly created trackcreateToken(array $tokenData, integer $userId = null
) : string
array
The other new data for the token
integer
Id of the user who takes the action (for logging)
string
createTrackClass(string $className, mixed $param1= null
, mixed $param2= null
) : object
inherited_from | \Gems_Tracker_TrackerInterface::createTrackClass() |
---|
string
mixed
mixed
object
filterChangesOnly(array $oldValues, array $newValues) : array
inherited_from | \Gems_Tracker_TrackerInterface::filterChangesOnly() |
---|
array
array
array
filterToken(string $tokenId) : string
inherited_from | \Gems_Tracker_TrackerInterface::filterToken() |
---|
string
string
Reformatted tokengetAllCodeFields() : array
inherited_from | \Gems_Tracker_TrackerInterface::getAllCodeFields() |
---|
array
id => codegetAppointment(mixed $appointmentData) : \Gems_Agenda_Appointment
inherited_from | \Gems_Tracker_TrackerInterface::getAppointment() |
---|
mixed
Appointment id or array containing appintment data
\Gems_Agenda_Appointment
getAskTokenForm(mixed $args_array = null
) : \Gems_Tracker_Form_AskTokenForm
inherited_from | \Gems_Tracker_TrackerInterface::getAskTokenForm() |
---|
mixed
\MUtil_Ra::args array for Form initiation.
\Gems_Tracker_Form_AskTokenForm
getRegistryRequests() : array
Returns those object variables defined by the subclass but not at the level of this definition.
Can be overruled.
array
of string namesgetRespondentTrack(mixed $respTrackData) : \Gems_Tracker_RespondentTrack
inherited_from | \Gems_Tracker_TrackerInterface::getRespondentTrack() |
---|
mixed
Track id or array containing trackdata
\Gems_Tracker_RespondentTrack
getRespondentTrackModel() : \Gems_Tracker_Model_RespondentTrackModel
inherited_from | \Gems_Tracker_TrackerInterface::getRespondentTrackModel() |
---|
\Gems_Tracker_Model_RespondentTrackModel
getRespondentTracks(integer $respondentId, integer $organizationId, mixed $order = array('gr2t_start_date')
) : array
Specify the optional $order to sort other than on start date
inherited_from | \Gems_Tracker_TrackerInterface::getRespondentTracks() |
---|
integer
integer
mixed
The column(s) and direction to order by
array
of \Gems_Tracker_RespondentTrackgetSource(mixed $sourceData) : \Gems_Tracker_Source_SourceInterface
Should only be called by \Gems_Tracker, \Gems_Tracker_Survey or \Gems_Tracker_Token (or should this one use \Gems_Tracker_Survey instead?)
inherited_from | \Gems_Tracker_TrackerInterface::getSource() |
---|
mixed
Gems source id or array containing gems source data
\Gems_Tracker_Source_SourceInterface
getSourceClasses() : array
inherited_from | \Gems_Tracker_TrackerInterface::getSourceClasses() |
---|
array
Of classname => descriptiongetSourceDatabaseClasses() : array
inherited_from | \Gems_Tracker_TrackerInterface::getSourceDatabaseClasses() |
---|
array
Of classname => descriptiongetSurvey(mixed $surveyData) : \Gems_Tracker_Survey
inherited_from | \Gems_Tracker_TrackerInterface::getSurvey() |
---|
mixed
Gems survey id or array containing gems survey data
\Gems_Tracker_Survey
getSurveyBySourceId(mixed $sourceSurveyId, integer $sourceId) : \Gems_Tracker_Survey
inherited_from | \Gems_Tracker_TrackerInterface::getSurveyBySourceId() |
---|
mixed
The source survey id
integer
The gems source id of the source
\Gems_Tracker_Survey
getSurveyModel(\Gems_Tracker_Survey $survey, \Gems_Tracker_Source_SourceInterface $source) : \Gems_Tracker_SurveyModel
inherited_from | \Gems_Tracker_TrackerInterface::getSurveyModel() |
---|
\Gems_Tracker_Survey
\Gems_Tracker_Source_SourceInterface
\Gems_Tracker_SurveyModel
getToken(mixed $tokenData) : \Gems_Tracker_Token
inherited_from | \Gems_Tracker_TrackerInterface::getToken() |
---|
mixed
Token id or array containing tokendata
\Gems_Tracker_Token
getTokenFilter() : \Gems_Tracker_Token_TokenFilter
inherited_from | \Gems_Tracker_TrackerInterface::getTokenFilter() |
---|
\Gems_Tracker_Token_TokenFilter
getTokenLibrary() : \Gems_Tracker_Token_TokenLibrary
inherited_from | \Gems_Tracker_TrackerInterface::getTokenLibrary() |
---|
\Gems_Tracker_Token_TokenLibrary
getTokenModel(string $modelClass = 'StandardTokenModel'
) : \Gems_Tracker_Model_StandardTokenModel
inherited_from | \Gems_Tracker_TrackerInterface::getTokenModel() |
---|
string
Optional class to use instead of StandardTokenModel. Must be subclass.
\Gems_Tracker_Model_StandardTokenModel
getTokenSelect($fields = '*'
) : \Gems_Tracker_Token_TokenSelect
inherited_from | \Gems_Tracker_TrackerInterface::getTokenSelect() |
---|
\Gems_Tracker_Token_TokenSelect
getTokenValidator() : \Gems_Tracker_Token_TokenValidator
inherited_from | \Gems_Tracker_TrackerInterface::getTokenValidator() |
---|
\Gems_Tracker_Token_TokenValidator
getTrackDisplayGroups() : array
inherited_from | \Gems_Tracker_TrackerInterface::getTrackDisplayGroups() |
---|
array
getTrackEngine(mixed $trackData) : \Gems_Tracker_Engine_TrackEngineInterface
inherited_from | \Gems_Tracker_TrackerInterface::getTrackEngine() |
---|
mixed
Gems track id or array containing gems track data
\Gems_Tracker_Engine_TrackEngineInterface
getTrackEngineClasses() : array
Instead of creating another object layer all classes defined by getTrackEngineClassNames() are loaded with dummy data so that the TrackEngineInterface functions containing general class information can be used.
see | |
---|---|
static | $dummyClasses Cache array |
inherited_from | \Gems_Tracker_TrackerInterface::getTrackEngineClasses() |
array
Of \Gems_Tracker_Engine_TrackEngineInterfacegetTrackEngineEditSnippets() : array
inherited_from | \Gems_Tracker_TrackerInterface::getTrackEngineEditSnippets() |
---|
array
of snippet names for creating a new track enginegetTrackEngineList(boolean $extended= false
, boolean $userCreatableOnly= false
) : array
inherited_from | \Gems_Tracker_TrackerInterface::getTrackEngineList() |
---|
boolean
When true return a longer name.
boolean
Return only the classes that can be created by the user interface
array
Of classname => descriptiongetTrackModel() : \Gems_Tracker_Model_TrackModel
inherited_from | \Gems_Tracker_TrackerInterface::getTrackModel() |
---|
\Gems_Tracker_Model_TrackModel
processCompletedTokens(integer $respondentId, integer $userId= null
, integer $orgId= null
, boolean $quickCheck= false
) : boolean
If the survey was started (and the token was forwarded to limesurvey) we need to check if is was completed. If so, we might want to check the track the survey is in to enable or disable future rounds
Does not reflect changes to tracks or rounds.
inherited_from | \Gems_Tracker_TrackerInterface::processCompletedTokens() |
---|
integer
Id of the respondent to check for or NULL
integer
Id of the user who takes the action (for logging)
integer
Optional Id of the organization to check for
boolean
Check only tokens with recent gto_start_time's
boolean
Did we find new answers?recalcTrackFields(string $batchId, integer $userId= null
, string $cond= null
) : \Gems_Task_TaskRunnerBatch
Does recalculate changed tracks
inherited_from | \Gems_Tracker_TrackerInterface::recalcTrackFields() |
---|
string
A unique identifier for the current batch
integer
Id of the user who takes the action (for logging)
string
Optional where statement for selecting tracks
\Gems_Task_TaskRunnerBatch
A batch to process the changesrecalculateTokens(string $batch_id, integer $userId= null
, string $cond= null
) : \Gems_Task_TaskRunnerBatch
Does not reflect changes to tracks or rounds.
inherited_from | \Gems_Tracker_TrackerInterface::recalculateTokens() |
---|
string
A unique identifier for the current batch
integer
Id of the user who takes the action (for logging)
string
\Gems_Task_TaskRunnerBatch
A batch to process the changesrefreshTokenAttributes(string $batch_id, string $cond = null
) : \Gems_Task_TaskRunnerBatch
inherited_from | \Gems_Tracker_TrackerInterface::refreshTokenAttributes() |
---|
string
A unique identifier for the current batch
string
An optional where statement
\Gems_Task_TaskRunnerBatch
A batch to process the changesremoveToken(string|\Gems_Tracker_Token $token) : \Gems_Tracker
inherited_from | \Gems_Tracker_TrackerInterface::removeToken() |
---|
string
\Gems_Tracker_Token
\Gems_Tracker
(continuation pattern)synchronizeSources(integer $sourceId= null
, integer $userId= null
) : \Gems_Task_TaskRunnerBatch
Does not reflect changes to tracks or rounds.
inherited_from | \Gems_Tracker_TrackerInterface::synchronizeSources() |
---|
integer
A source identifier
integer
Id of the user who takes the action (for logging)
\Gems_Task_TaskRunnerBatch
A batch to process the synchronization_cascadedDirs(array $dirs, string $cascade, boolean $fullClassnameFallback = true
) : array
array
prefix => path
string
The sub directories to cascade to
boolean
Allows full class name specification instead of just plugin name part
array
prefix => path_getClass(string $name, string $className= null
, array $arguments= array()
) : mixed
string
The $name of the variable to store this object in.
string
Class name or null if the same as $name, prepending $this->_dirs.
array
Class initialization arguments.
mixed
Instance of $className_loadClass(string $name, boolean $create= false
, array $arguments= array()
) : mixed
filterRequestNames(string $name) : boolean
Can be overriden.
string
boolean
getTrackEngineClassNames() : array
array
Of classnameprocessTokensBatch(string $batch_id, \Gems_Tracker_Token_TokenSelect $tokenSelect, integer $userId) : \Gems_Task_TaskRunnerBatch
If the survey was started (and the token was forwarded to limesurvey) we need to check if is was completed. If so, we might want to check the track the survey is in to enable or disable future rounds
Does not reflect changes to tracks or rounds.
string
A unique identifier for the current batch
\Gems_Tracker_Token_TokenSelect
Select statements selecting tokens
integer
Id of the user who takes the action (for logging)
\Gems_Task_TaskRunnerBatch
A batch to process the changes_checkUserId(integer $userId = null
) : integer
integer
integer
$verbose : boolean
false
$_dirs : array
The standard value is
But an alternative could be:
$_loader : \MUtil_Loader_PluginLoader
$_sourceClasses : array
array('LimeSurvey1m9Database' => 'Lime Survey 1.90 DB', 'LimeSurvey1m91Database' => 'Lime Survey 1.91+ DB', 'LimeSurvey2m00Database' => 'Lime Survey 2.00 DB')
$cascade : string
'Tracker'
$cascade : string
null
$currentUser : \Gems_User_User
$db : \Zend_Db_Adapter_Abstract
$loader : \Gems_Loader
$logger : \Gems_Log
$session : \Zend_Session
$translate : \Zend_Translate
$_respTracks : array
array()
$_sources : array
array()
$_surveys : array
array()
$_tokenLibrary : \Gems_Tracker_TokenLibrary
$_tokenModels : array
array()
$_tokens : array
array()
$_trackEngines : array
array()
DB_DATETIME_FORMAT = 'yyyy-MM-dd HH:mm:ss'
DB_DATE_FORMAT = 'yyyy-MM-dd'