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)
integer
Survey ID
string
(ISO) Language
\Zend_Db_Adapter_Abstract
The Lime Survey database connection
\Zend_Translate
A translate object
\type
The 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
.
string
Optional type filter
array
fieldname => labelgetQuestionInformation() : array
array
Nested arraygetQuestionList(string $forType = false
) : array
.
string
Optional type filter
array
fieldname => labelhandleFloat(\The $value) : float
\The
number to cast to float
float
mapKeysToTitles(array $values)
array
mapTitlesToKeys(array $values)
array
removeMarkup(string $text) : string
string
Input possibly containing html
string
_getAnswersTableName() : string
string
name of the answers table_getGroupsTableName() : string
string
name 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
string
name of the question attributes table_getQuestionsTableName() : string
All non-text data is replicated over all the question/language rows.
string
name of the questions table_getSurveyTableName() : string
string
Name of survey table for this survey_getSurveysTableName() : string
string
name 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
integer
Question ID
integer
Scale 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'