MultipleChoiceVariable
in package
implements
MultipleChoiceVariableInterface
uses
GetName, GetTitle, GetRawConfiguration
Read onlyYes
FinalYes
Table of Contents
Interfaces
Properties
- $dataPath : array<string|int, mixed>
- $name : string
- $ordered : bool
- $rawConfiguration : array<string|int, mixed>
- $titles : array<string|int, mixed>
- $valueMap : array<int|string, ValueOptionInterface>
- We can say this is non-empty, since valueoptions is non-empty, and this is a direct mapping from valueoptions
Methods
- __construct() : mixed
- getMeasure() : Measure
- getName() : string
- getNumberOfOptions() : int
- getOptions() : array<int, ValueOptionInterface>
- getRawConfigurationValue() : mixed
- getTitle() : string
- getValue() : SpecialValueInterface|MultipleChoiceValue
- isOrdered() : bool
- This is used to identify ranking questions; they contain the same data as other multiple choice questions but the order of the values is relevant
Properties
$dataPath
private
array<string|int, mixed>
$dataPath
$name
private
string
$name
$ordered
private
bool
$ordered
= false
$rawConfiguration
private
array<string|int, mixed>
$rawConfiguration
= []
$titles
private
array<string|int, mixed>
$titles
= []
$valueMap
We can say this is non-empty, since valueoptions is non-empty, and this is a direct mapping from valueoptions
private
array<int|string, ValueOptionInterface>
$valueMap
Methods
__construct()
public
__construct(string $name, array<int, string> $dataPath, array<int, ValueOptionInterface> $options[, array<string, string> $titles = [] ][, array<string|int, mixed> $rawConfiguration = [] ][, bool $ordered = false ]) : mixed
Parameters
- $name : string
- $dataPath : array<int, string>
- $options : array<int, ValueOptionInterface>
- $titles : array<string, string> = []
- $rawConfiguration : array<string|int, mixed> = []
- $ordered : bool = false
getMeasure()
public
getMeasure() : Measure
Return values
MeasuregetName()
public
getName() : string
Return values
stringgetNumberOfOptions()
public
getNumberOfOptions() : int
Return values
intgetOptions()
public
getOptions() : array<int, ValueOptionInterface>
Return values
array<int, ValueOptionInterface>getRawConfigurationValue()
public
getRawConfigurationValue(string|int $key) : mixed
Parameters
- $key : string|int
getTitle()
public
getTitle([string|null $locale = null ]) : string
Parameters
- $locale : string|null = null
Return values
stringgetValue()
public
getValue(RecordInterface $record) : SpecialValueInterface|MultipleChoiceValue
Parameters
- $record : RecordInterface
Return values
SpecialValueInterface|MultipleChoiceValueisOrdered()
This is used to identify ranking questions; they contain the same data as other multiple choice questions but the order of the values is relevant
public
isOrdered() : bool
Return values
bool —whether the value ordering is relevant.