class Choice

This class allows the storage and retrieval of the attributes of a choice

A choice is a value chosen by a user in a list and assigned to a data item.

Properties

private Data $data
private int $id
private string $value
private string $label
private bool $selected

Methods

void
__construct(Data $data, int $id, string $value, string $label)

Constructor of class Choice

int
getId()

Retrieves the ID of this choice

void
setId(int $id)

Sets the ID of this choice

getData()

Retrieves the Data object that uses this choice

string
getValue()

Retrieves the value of this choice

void
setValue(string $value)

Sets the value of this choice

string
getLabel()

Retrieves the label of this choice

void
setLabel(string $label)

Sets the label of this choice

bool
isSelected()

Retrieves the selected attribute of this Choice object

bool
getSelected()

Retrieves the selected attribute of this Choice object

void
setSelected(bool $selected)

Determines whether this choice is selected or not

string
getClass()

Returns the class name of this Choice object

Details

at line 92
void __construct(Data $data, int $id, string $value, string $label)

Constructor of class Choice

Parameters

Data $data The Data object that uses this choice
int $id The ID of this choice
string $value The value of this choice
string $label The label of this choice

Return Value

void

at line 106
int getId()

Retrieves the ID of this choice

Return Value

int The choice ID

at line 118
void setId(int $id)

Sets the ID of this choice

Parameters

int $id Choice id

Return Value

void

at line 129
Data getData()

Retrieves the Data object that uses this choice

Return Value

Data the Data object

at line 140
string getValue()

Retrieves the value of this choice

Return Value

string The choice value

at line 152
void setValue(string $value)

Sets the value of this choice

Parameters

string $value The value of this choice

Return Value

void

at line 163
string getLabel()

Retrieves the label of this choice

Return Value

string The label of this choice

at line 175
void setLabel(string $label)

Sets the label of this choice

Parameters

string $label The label of this choice

Return Value

void

at line 186
bool isSelected()

Retrieves the selected attribute of this Choice object

Return Value

bool The selected attribute

at line 197
bool getSelected()

Retrieves the selected attribute of this Choice object

Return Value

bool The selected attribute

at line 209
void setSelected(bool $selected)

Determines whether this choice is selected or not

Parameters

bool $selected true if this choice is selected, false otherwise

Return Value

void

at line 220
string getClass()

Returns the class name of this Choice object

Return Value

string the class name