A fieldmap object adds LS source code knowledge and interpretation to the database data about a survey. This enables the code to work with the survey object.
| package | Gems |
|---|---|
| subpackage | Tracker |
| copyright | Copyright (c) 2011 Erasmus MC |
| license | New BSD License |
| since | Class available since version 1.4 |
| inherited_from | \Gems_Tracker_Source_LimeSurvey1m9FieldMap |
__construct(integer $sourceSurveyId, string $language, \Zend_Db_Adapter_Abstract $lsDb, \Zend_Translate $translate, \type $tablePrefix)
integerSurvey ID
string(ISO) Language
\Zend_Db_Adapter_AbstractThe Lime Survey database connection
\Zend_TranslateA translate object
\typeThe prefix to use for all LS tables (in this installation)
applyToModel(\MUtil_Model_ModelAbstract $model)
| inherited_from | \Gems_Tracker_Source_LimeSurvey1m9FieldMap::applyToModel() |
|---|
\MUtil_Model_ModelAbstract
applyToModel(\MUtil_Model_ModelAbstract $model)
\MUtil_Model_ModelAbstract
getFullQuestionList(string $forType = false) : array
.
stringOptional type filter
arrayfieldname => labelgetQuestionInformation() : array
arrayNested arraygetQuestionList(string $forType = false) : array
.
stringOptional type filter
arrayfieldname => labelhandleFloat(\The $value) : float
\Thenumber to cast to float
floatmapKeysToTitles(array $values)
array
mapTitlesToKeys(array $values)
array
removeMarkup(string $text) : string
stringInput possibly containing html
string_getAnswersTableName() : string
stringname of the answers table_getGroupsTableName() : string
stringname of the groups table_getMap()
_getMultiOptions($field)
Field from getFieldMap function
_getQuestionAttribute(string $qid, string $subId, \mxied $default = null) : mixed
string
string
\mxied
mixed_getQuestionAttributesTableName() : string
stringname of the question attributes table_getQuestionsTableName() : string
All non-text data is replicated over all the question/language rows.
stringname of the questions table_getSurveyTableName() : string
stringName of survey table for this survey_getSurveysTableName() : string
stringname of the surveys table_getType($field) : integer
Field from _getMap function
integer\MUtil_Model::TYPE_ constantgetDateFormats($fieldname, $type)
getFieldTableDataType($fieldname)
loadTableMetaData()
_getFixedAnswers($type)
_getHardAnswers(integer $qid, integer $scale_id)
Uses 1 query to retrieve all answers and serves them as needed
integerQuestion ID
integerScale ID
_getPossibleAnswers($field)
Field from getFieldMap function
_getTitlesMap() : array
array$_answers
$_attributes
$_fieldMap
$_hardAnswers
$_titlesMap
$cache : \Zend_Cache_Core
$language : string
$ldDb : \Zend_Db_Adapter_Abstract
$sourceSurveyId : integer
$tableMetaData
$tablePrefix : string
$translate : \Zend_Translate
ANSWERS_TABLE = 'answers'
ATTRIBUTES_TABLE = 'question_attributes'
GROUPS_TABLE = 'groups'
INTERNAL = 'stamp'
QUESTIONS_TABLE = 'questions'