class ChoiceGroup

This class allows the storage and retrieval of the attributes of a group of choices

The list of choices of a choice group can either be defined by extension, or be the result of a query on a data source.

Properties

private string $label
private array $choices
private ChoiceSource $choiceSource

Methods

void
__construct(string $label)

Constructor of class ChoiceGroup

string
getLabel()

Retrieves the label of this group of choices

void
setLabel(string $label)

Sets the label of this group of choices

array
getChoices()

Returns the list of all the choices that have been defined by extension

void
setChoices(array $choices)

Sets the list of all the choices that have been defined by extension

void
addChoice(Choice $choice)

Adds a Choice object to the list of choices

Choice|null
getChoiceById(int $id)

Retrieves a Choice object by its ID

getChoiceSource()

Retrieves the ChoiceSource object of this group of choices

void
setChoiceSource(ChoiceSource $choiceSource)

Sets the ChoiceSource object of this group of choices

string
getClass()

Returns the class name of this ChoiceGroup object

Details

at line 73
void __construct(string $label)

Constructor of class ChoiceGroup

Parameters

string $label The label of this group of choices

Return Value

void

at line 84
string getLabel()

Retrieves the label of this group of choices

Return Value

string The label of this group of choices

at line 96
void setLabel(string $label)

Sets the label of this group of choices

Parameters

string $label The label of this group of choices

Return Value

void

at line 107
array getChoices()

Returns the list of all the choices that have been defined by extension

Return Value

array The list of all the choices

at line 119
void setChoices(array $choices)

Sets the list of all the choices that have been defined by extension

Parameters

array $choices The list of all the choices

Return Value

void

at line 131
void addChoice(Choice $choice)

Adds a Choice object to the list of choices

Parameters

Choice $choice The Choice object to add

Return Value

void

at line 143
Choice|null getChoiceById(int $id)

Retrieves a Choice object by its ID

Parameters

int $id The ID of the choice

Return Value

Choice|null The Choice object with this ID

at line 161
ChoiceSource getChoiceSource()

Retrieves the ChoiceSource object of this group of choices

The ChoiceSource object contains the columns of the result of the query that populate this group of choices.

Return Value

ChoiceSource The ChoiceSource object

at line 175
void setChoiceSource(ChoiceSource $choiceSource)

Sets the ChoiceSource object of this group of choices

The ChoiceSource object contains the columns of the result of the query that populate this group of choices.

Parameters

ChoiceSource $choiceSource The ChoiceSource object

Return Value

void

at line 186
string getClass()

Returns the class name of this ChoiceGroup object

Return Value

string the class name