Class Question
package | Default |
---|
beforeSave(): boolean
boolean
behaviors(): array
Below is a list of all behaviors we register:
see | \CTimestampBehavior\PluginEventBehavior |
---|---|
array
decrypt( $value = '')
decryptEncryptAttributes( $action = 'decrypt')
decryptSingle(string $value = '')
string
String value which needs to be decrypted
delete(): boolean
Throws |
|
---|
boolean
deleteAllAnswers()
deleteAllByAttributes(array $attributes,string $condition = '',array $params = array()): integer
todo | This should also be moved to the behavior at some point. This method overrides the parent in order to raise PluginEvents for Bulk delete operations. Filter Criteria are wrapped into a CDBCriteria instance so we have a single instance responsible for holding the filter criteria to be passed to the PluginEvent, this also enables us to pass the fully configured CDBCriteria instead of the original Parameters. See {@link find()} for detailed explanation about $condition and $params. |
---|
array
list of attribute values (indexed by attribute names) that the active records should match. An attribute value can be an array which will be used to generate an IN condition.
string
query condition or criteria.
array
parameters to be bound to an SQL statement.
integer
number of rows affected by the execution.
deleteAllById(mixed $questionsIds): void
mixed
dispatchPluginModelEvent(string $sEventName,\CDbCriteria $criteria = null,array $eventParams = array(): \PluginEvent
)
string
\CDbCriteria
array
\PluginEvent
encrypt()
encryptAttributeValues(array $attributes = null, $bEncryptedOnly = false, $bReplaceValues = true): array
array
list of attribute values (indexed by attribute names) that the active records should match. An attribute value can be an array which will be used to generate an IN condition.
array
attributes array with encrypted atrribute values is returned
encryptSave( $runValidation = false)
encryptSingle(string $value = '')
string
String value which needs to be decrypted
findAllAsArray(mixed $condition = '',array $params = array()): array
See \find() for detailed explanation about $condition and $params.
mixed
query condition or criteria.
array
parameters to be bound to an SQL statement.
array
list of active records satisfying the specified condition. An empty array is returned if none is found.
findAllByAttributes(array $attributes,mixed $condition = '',array $params = array()): array<mixed,static>
array
list of attribute values (indexed by attribute names) that the active records should match. An attribute value can be an array which will be used to generate an IN condition.
mixed
query condition or criteria.
array
parameters to be bound to an SQL statement.
array<mixed,static>
the records found. An empty array is returned if none is found.
findByAttributes(array $attributes,mixed $condition = '',array $params = array()): static|null
array
list of attribute values (indexed by attribute names) that the active records should match. An attribute value can be an array which will be used to generate an IN condition.
mixed
query condition or criteria.
array
parameters to be bound to an SQL statement.
static|null
the record found. Null if none is found.
fixSubQuestions(): void
todo | : move other fix here ? |
---|---|
getAdvancedSettingsWithValues(integer $iQuestionID,string $sQuestionType,integer $iSurveyID,string $sLanguage = null): array
access | public |
---|
integer
The question ID - if 0 then all settings will use the default value
string
The question type
integer
string
If you give a language then only the attributes for that language are returned
array
getAllEncryptedAttributes(integer $iSurveyId,string $sClassName): array
integer
string
array
getAllSubQuestionIds(): array
array
getBasicFieldName()
getDataSetObject( $type = null)
getHasSubquestions()
getInstance( $iSurveyId, $type)
getMandatoryIcon()
getMaxId(string $field = null,boolean $forceRefresh = false): false|integer
This is a convenience method, that uses the primary key of the model to retrieve the highest value.
Throws |
|
---|
string
The field that contains the Id, when null primary key is used if it is a single field
boolean
Don't use value from static cache but always requery the database
false|integer
getMinId(string $field = null,boolean $forceRefresh = false): false|integer
This is a convenience method, that uses the primary key of the model to retrieve the highest value.
Throws |
|
---|
string
The field that contains the Id, when null primary key is used if it is a single field
boolean
Don't use value from static cache but always requery the database
false|integer
getNewTitle(integer $index): string|null
integer
base for question code (exemple : inde of question when survey import)
string|null
: new title, null if impossible
getOrderedAnswers( $scale_id = null)
getOrderedSubQuestions( $scale_id = null): array
array
getOtherIcon()
getQuestionAttribute( $sAttribute): array<mixed,\QuestionAttribute>
getQuestionAttributes(): array<mixed,\QuestionAttribute>
getQuestionClass( $sType): string
string
Question class to be added to the container
Maybe move class in typeList ? //TODO move to QuestionType
getQuestionList(integer $surveyid): array<mixed,\Question>
getQuestionListColumns()
getQuestions(integer $sid,integer $gid): \CDbDataReader
integer
integer
\CDbDataReader
getQuestionsForStatistics(string $fields,mixed $condition,string $orderby = false): array
string
mixed
string
array
getQuestionTemplateAttributes(array $aAttributeNames,array $aAttributeValues,\Question $oQuestion): mixed
array
the values from getQuestionAttributesSettings($sType)
array
$attributeValues['question_template'] != 'core', only if this is true the function changes something
mixed
returns the incoming parameter $aAttributeNames or
getQuestionTypeName( $sType): string
deprecated | use $this->>questionType->description instead |
---|
string
Question type name
Maybe move class in typeList ?
getQuotableTypes(): array<mixed,string>
array<mixed,string>
getRenderererObject( $aFieldArray, $type = null)
getTypedesc(): string
string
getTypeGroup()
insertRecords(array $data): boolean|null
array
boolean|null
model( $class = __CLASS__): \Question
primaryKey()
inheritdoc | |
---|---|
query(\CDbCriteria $criteria,boolean $all = false,boolean $asAR = true): mixed
Performs the actual DB query and populates the AR objects with the query result. This method is mainly internally used by other AR query methods.
since | 1.1.7 |
---|
\CDbCriteria
the query criteria
boolean
whether to return all data
boolean
mixed
the AR objects populated with the query result
relations()
inheritdoc | |
---|---|
removeFromLastVisited()
removeInvalidSubquestions()
rules()
inheritdoc | TODO: make it easy to read (if possible) |
---|---|
search()
setEncryptedAttributeLabel(integer $surveyId,string $className,string $attributeName): string
Throws |
|
---|
integer
string
string
string
tableName()
inheritdoc | |
---|---|
typeList(string $language = null): array
deprecated | use QuestionType::modelsAttributes() instead |
---|
string
Language for translation
array
The question type definitions
Explanation of questiontype array:
description : Question description subquestions : 0= Does not support subquestions x=Number of subquestion scales answerscales : 0= Does not need answers x=Number of answer scales (usually 1, but e.g. for dual scale question set to 2) assessable : 0=Does not support assessment values when editing answerd 1=Support assessment values
update( $attributes = null)
updateQuestionOrder(integer $gid,integer $startingOrder = 1)
integer
integer
the starting question order.
updateSortOrder(integer $gid,integer $surveyid): void
static | |
---|---|
access | public |
integer
integer
QT_1_ARRAY_MULTISCALE
QT_5_POINT_CHOICE
QT_A_ARRAY_5_CHOICE_QUESTIONS
QT_B_ARRAY_10_CHOICE_QUESTIONS
QT_C_ARRAY_YES_UNCERTAIN_NO
QT_D_DATE
QT_E_ARRAY_OF_INC_SAME_DEC_QUESTIONS
QT_F_ARRAY_FLEXIBLE_ROW
QT_G_GENDER_DROPDOWN
QT_H_ARRAY_FLEXIBLE_COLUMN
QT_I_LANGUAGE
QT_K_MULTIPLE_NUMERICAL_QUESTION
QT_L_LIST_DROPDOWN
QT_M_MULTIPLE_CHOICE
QT_N_NUMERICAL
QT_O_LIST_WITH_COMMENT
QT_P_MULTIPLE_CHOICE_WITH_COMMENTS
QT_Q_MULTIPLE_SHORT_TEXT
QT_R_RANKING_STYLE
QT_S_SHORT_FREE_TEXT
QT_T_LONG_FREE_TEXT
QT_U_HUGE_FREE_TEXT
QT_X_BOILERPLATE_QUESTION
QT_Y_YES_NO_RADIO
QT_Z_LIST_RADIO_FLEXIBLE
QT_EXCLAMATION_LIST_DROPDOWN
QT_VERTICAL_FILE_UPLOAD
QT_ASTERISK_EQUATION
QT_COLON_ARRAY_MULTI_FLEX_NUMBERS
QT_SEMICOLON_ARRAY_MULTI_FLEX_TEXT
group_name :string
var | Stock the active group_name for questions list filtering |
---|
string
gid :
bEncryption :
qid :integer
Question ID.
integer
sid :integer
Survey ID
integer
gid :integer
QuestionGroup ID where question is displayed
integer
type :string
string
title :string
Question Code
string
preg :string
string
other :string
Other option enabled for question (Y/N)
string
mandatory :string
Whether question is mandatory (Y/S/N)
string
encrypted :string
Whether question is encrypted (Y/N)
string
question_order :integer
Question order in greoup
integer
parent_qid :integer
Questions parent question ID eg for subquestions
integer
scale_id :integer
The scale ID
integer
same_default :integer
Saves if user set to use the same default value across languages in default options dialog
integer
relevance :string
Questions relevane equation
string
modulename :string
string
survey :\Survey
\Survey
groups :\QuestionGroup
//@TODO should be singular
\QuestionGroup
parents :\Question
//@TODO should be singular
\Question
subquestions :array<mixed,\Question>
array<mixed,\Question>
questionAttributes :array<mixed,\QuestionAttribute>
NB! returns all QuestionArrtibute Models fot this QID regardless of the specified language
array<mixed,\QuestionAttribute>
questionl10ns :array<mixed,\QuestionL10n>
Question Languagesettings indexd by language code
array<mixed,\QuestionL10n>
quotableTypes :array<mixed,string>
Question types that can be used for quotas
array<mixed,string>
answers :array<mixed,\Answer>
array<mixed,\Answer>
questionType :\QuestionType
\QuestionType
allSubQuestionIds :array
QID-s of all question sub-questions, empty array returned if no sub-questions
array