public function __construct(Traversable
$choices,
array
$labels,
array
$preferredChoices )
Parameters
$choices
—
object
The array of choices. Choices may also be given as hierarchy of unlimited depth. Hierarchies are created by creating nested arrays. The title of the sub-hierarchy can be stored in the array key pointing to the nested array. The topmost level of the hierarchy may also be a \Traversable.
$labels
—
array
The array of labels. The structure of this array should match the structure of $choices.
$preferredChoices
—
array
A flat array of choices that should be presented to the user with priority.