Abstract implementation of SourceInterface containing basic utilities and logical separation between the Gems database and the Source database
| package | Gems |
|---|---|
| subpackage | Tracker |
| copyright | Copyright (c) 2011 Erasmus MC |
| license | New BSD License |
| since | Class available since version 1.2 |
__construct(array $sourceData, \Zend_Db_Adapter_Abstract $gemsDb)
| inherited_from | \Gems_Tracker_Source_SourceInterface::__construct() |
|---|
arrayThe information from gems__sources for this source.
\Zend_Db_Adapter_AbstractDo not want to copy db using registry because that is public and this should be private
getId() : integer
| inherited_from | \Gems_Tracker_Source_SourceInterface::getId() |
|---|
integerThe source Id of this sourcegetRawTokenAnswerRowsCount(array $filter, integer $surveyId, string $sourceSurveyId = null) : integer
Abstract implementation is not efficient, sources should handle this as efficient as possible.
| inherited_from | \Gems_Tracker_Source_SourceInterface::getRawTokenAnswerRowsCount() |
|---|
arrayfilter array
integerGems Survey Id
stringOptional Survey Id used by source
integergetSourceDatabase() : \Zend_Db_Adapter_Abstract
| inherited_from | \Gems_Tracker_Source_SourceInterface::getSourceDatabase() |
|---|
\Zend_Db_Adapter_AbstractsynchronizeSurveyBatch(\Gems_Task_TaskRunnerBatch $batch, integer $userId) : array
| inherited_from | \Gems_Tracker_Source_SourceInterface::synchronizeSurveyBatch() |
|---|
\Gems_Task_TaskRunnerBatch
integerId of the user who takes the action (for logging)
arrayReturns an array of messages_getGemsSurveysForSynchronisation() : array
arrayPairs gemsId => sourceId_getSourceSurveysForSynchronisation() : array
arrayof sourceId values or false_getTokenFromSqlWhere(string $from, string $fieldName) : string
stringThe tokens that should not occur
stringName of database field to use
string_getTokenFromToSql(string $from, string $to, string $fieldName) : string
stringThe tokens that should not occur
stringThe tokens that replace them
stringName of database field to use
string_updateGemsSurveyExists(array $surveyorSids, integer $userId) : array
arrayThe gsu_surveyor_id's that ARE in the source
integerId of the user who takes the action (for logging)
arrayThe names of the surveys that no longer exist_updateSource(array $values, integer $userId) : integer
arrayThe values that this source should be set to
integerThe current user
integer1 if data changed, 0 otherwiseaddDatabasePrefix(\return $tableName, boolean $addDatabaseName = true) : string
\return
booleanOptional, when true (= default) and there is a database name then it is prepended to the name.
stringfilterLimitOffset(array $filter, \Zend_Db_Select $select)
array
\Zend_Db_Select
getBaseUrl() : string
stringBase url for sourcegetSurveyData(integer $surveyId, string $field = null) : array
Uses internal caching to prevent multiple db lookups during a program run (so no caching beyond page generation time)
integer
stringOptional field to retrieve data for
arrayupdateTokens(integer $userId, $updateTokens = true) : integer
integerId of the user who takes the action (for logging)
integerThe number of tokens changed$project : \Gems_Project_ProjectSettings
$tracker : \Gems_Tracker
$_gemsDb : \Gems_Task_TaskRunnerBatch: \Zend_Db_Adapter_Abstract
$_sourceData : array
$_sourceDb : \Zend_Db_Adapter_Abstract