Module::arrayToModuleFields is intended to be a general helper method for converting an array to module fields for all field types. It's not intended to support the use of every parameter that could be passed to every other module field call, such as option_attributes for select fields. You may also notice that it does not support attributes for labels, or to allow label tags to be preserved. Likewise, multi-select fields are not supported.
If you needed to set those specific fields or attributes, you could create those as individual ModuleFields separately and pass them in the second parameter to Module::arrayToModuleFields. Otherwise, you could write a specific helper method for your module to aid in module field construction.
As I mentioned in my earlier post, the currently-selected value for a field should be set in the third parameter ($vars) passed into ModuleFields::arrayToModuleFields, and field attributes set via key "attributes" in $arr.
e.g.
// Fields
$arr = array(
'country' => array(
'label' => Language::_("Webdrive.whois.Country", true),
'type' => "select",
'options' => array(
'NZ' => "New Zealand"
),
'attributes' => array(
'placeholder' => Language::_("Webdrive.whois.Country", true)
)
),
);
// Selected values
$vars = (object)array(
'country' => "NZ"
);
$fields = $this->arrayToModuleFields($arr, null, $vars);