package | Default |
---|
attributeAppliesToQuestionType(array $attribute,string $questionType): boolean
array
question attribute definition
string
the question type that the attribute should apply to
boolean
returns true if the question attribute applies to the specified question type
categorySort(\LimeSurvey\Models\Services\array<string,mixed> $a,\LimeSurvey\Models\Services\array<string,mixed> $b): integer
todo | No state used, so no OOP needed, move to function at some point. |
---|
\LimeSurvey\Models\Services\array
First question attribute to compare
\LimeSurvey\Models\Services\array
Second question attribute to compare
integer
fillAttributesWithValues(array $attributes,array $attributeValues,array $languages = array()): array
Both this and rewriteQuestionAttributeArray() are helper methods and accomplish quite similar tasks, but the output is different: rewriteQuestionAttributeArray returns a name -> value array, while here we return a complete definition map and the value as a piece of information mingled into it.
todo | Pure function - move outside class? |
---|
array
the attributes to be filled
array
the values for the attributes
array
the languages to use for i18n attributes
array
the same source attributes with their corresponding values (when available)
fillMissingCategory(array $attributes, $categoryName): array
array
array of question attribute definitions
array
returns the array attributes with Category field complete
filterAttributesByQuestionType(array $attributes,string $questionType): array
array
array of question attribute definitions to filter
string
the question type that the attributes should apply to
array
an array containing only the question attributes that match the specified question type
getCategoryOrders(): \LimeSurvey\Models\Services\array<string,int>
The array doesn't contain all the posible categories, only those with an order assigned.
\LimeSurvey\Models\Services\array
getQuestionAttributesWithValues(\Question $question,string|null $language = null,string|null $questionThemeOverride = null,boolean $advancedOnly = false): array
string|null
If you give a language then only the attributes for that language are returned
string|null
Name of the question theme to use instead of the question's current theme
boolean
If set to true, only the advanced attributes will be returned
array
getUserDefaultsForQuestionType(string $questionType): \LimeSurvey\Models\Services\array<string,mixed>
string
\LimeSurvey\Models\Services\array
groupAttributesByCategory(array $attributes): array
Used by advanced settings widget.
todo | Pure function - move outside class? |
---|
array
array
Grouped question attributes, with category as array key
mergeQuestionAttributes(array $baseAttributes,array $extendedAttributes): array
If an extended attribute's name cannot be determined, it's omitted.
array
the base set of attributes
array
the attributes to merge into the base set
array
the merged attributes
sanitizeQuestionAttributes(array $attributes): \LimeSurvey\Models\Services\array<string,array>
Current tasks:
todo | Pure function - move outside class? |
---|
array
the array of attributes to sanitize
\LimeSurvey\Models\Services\array
the array of sanitized attributes
sortAttributesByCategory(\LimeSurvey\Models\Services\array<string,array> $attributes): \LimeSurvey\Models\Services\array<string,array>
Sorting is based on a predefined list of orders (see QuestionAtributeHelper::getCategoryOrders()). Categories without a predefined order are considered less relevant. Categories with the same order are sorted alphabetically.
\LimeSurvey\Models\Services\array
\LimeSurvey\Models\Services\array