NAME

Podius::Property::MultipleSelections - component property allowing multiple selections from multiple choices


SYNOPSIS

  $property = new Podius::Property::MultipleSelections;

Supposed to be used in the Podius::Component manpage and the Podius::Property manpage module trees only.


DESCRIPTION

This module implements component property of multiple choices with multiple selections. See also the Podius::Property::Selection manpage for a component property of multiple choice with a single selection.

The selection is one code (scalar, often integer or short string) from list of possible codes. This property operates with array of selections (codes).

If a constant array of choices is supplied in the class constructor, the label of this property is taken as a chosen code, when appropriate. If, instead, a constant code->label hash is supplied in the class constructor, it is used to translate from choice code to its label, when appropriate.

Note, access modifier method supposes to get an array of choice codes as parameter, not labels; access accessor method returns an array of choice code, not labels. Use access_labels instead. access_codes is an alias to access.


REQUIREMENTS

the Exception manpage, the Podius::Property::ScalarList manpage.


CONSTRUCTORS

new

description
Class constructor.

parameters
Class name, array or hash of choice codes and optional array of initial codes (default is empty, i.e. no selection).

returns
New formed property reference.


METHODS

access_labels

description
This method is similar to access method inherited from superclass the Podius::Property::ScalarList manpage, but choice labels are used instead of choice codes (codes are evaluated from their labels).

Accessor: returns the currently selected choice labels.

Modifier: sets a new list of selected choice labels. If any given label is not found, it is ignored.

parameters
Accessor: none.

Modifier: choice labels (array of strings).

returns
Accessor: selected choice labels (array of strings).

Modifier: new selected choice codes (array of scalars).

access_all_codes

description
Only accessor form is available.

Returns a list of all possible choice codes.

returns
Array ref of scalars.

access_all_labels

description
Only accessor form is available.

Returns a list of all possible choice labels.

returns
Array ref of scalars.

access_all_code_labels

description
Only accessor form is available.

Returns a hash of all possible choices: {code =>* label}.

returns
Hash ref of scalar-to-scalar's.

access_initial_codes

description
Only accessor form is available.

Returns a value that is used to initialized this property.

returns
Array ref of scalars.

reset

description
May be used to reset the selected list of options, see also access_initial_codes method.

returns
This object itself.

access_is_selected

description
Checks whether the given option is selected or not.

parameters
Code or label to be queried.

returns
Boolean.

access_bits

description
Returns indexes of selected options. For example, an empty array if nothing is selected, or array [0 .. N - 1] if everything is selected.

returns
Array ref of sorted integers.


ALIASES

access_codes
An alias to access method.