LimeSurvey API - Master branch

QuestionAttributeFetcher
in package

Fetches question attribute definitions from the available providers

Table of Contents

Properties

$options  : array<string, mixed>
$providers  : array<string|int, QuestionAttributeProvider>
$question  : Question

Methods

__construct()  : mixed
fetch()  : array<string, array<string|int, mixed>>
Returns the question attribute definitions according to the specified filters, from all available sources.
populateValues()  : array<string, array<string|int, mixed>>
Populates the $attributeDefinitions with their corresponding values.
resetOptions()  : mixed
Clears the filters
setAdvancedOnly()  : mixed
Convenience method to add the 'advancedOnly' filter
setOption()  : mixed
Adds a new filter or overrides an existing one
setQuestion()  : mixed
Sets the question to use when fetching the attributes
setQuestionType()  : mixed
Convenience method to add a question type filter
setTheme()  : mixed
Convenience method to add a question theme filter

Properties

Methods

__construct()

public __construct([mixed $providers = null ]) : mixed
Parameters
$providers : mixed = null

fetch()

Returns the question attribute definitions according to the specified filters, from all available sources.

public fetch() : array<string, array<string|int, mixed>>
Tags
throws
InvalidArgumentException

if no question is specified

Return values
array<string, array<string|int, mixed>>

array of question attribute definitions

populateValues()

Populates the $attributeDefinitions with their corresponding values.

public populateValues(array<string, array<string|int, mixed>> $attributeDefinitions[, string|null $language = null ]) : array<string, array<string|int, mixed>>

If no $language is specified, the values for all survey languages are retrieved. A question must be set with QuestionAttributeFetcher::setQuestion() before calling this method.

Parameters
$attributeDefinitions : array<string, array<string|int, mixed>>

the array of attribute definitions that will be filled with values

$language : string|null = null

the language to use for i18n enabled attributes. If null, all survey languages are considered.

Tags
throws
Exception

if the question ()

TODO: Move to QuestionAttributeHelper? Not sure if it belongs here.

Return values
array<string, array<string|int, mixed>>

the attributes from $attributeDefinitions, with their values.

setAdvancedOnly()

Convenience method to add the 'advancedOnly' filter

public setAdvancedOnly(bool $advancedOnly) : mixed
Parameters
$advancedOnly : bool

setOption()

Adds a new filter or overrides an existing one

public setOption(string $key, mixed $value) : mixed
Parameters
$key : string

the name of the filter

$value : mixed

setQuestionType()

Convenience method to add a question type filter

public setQuestionType(string $questionType) : mixed
Parameters
$questionType : string

the name of the question theme

setTheme()

Convenience method to add a question theme filter

public setTheme(string $questionTheme) : mixed
Parameters
$questionTheme : string

the name of the question theme


        
On this page

Search results