/**
* Method to get the field options.
*
* @return array The field option objects.
*
* @since 3.4
*/
protected function getOptions()
{
$options = array();
foreach ($this->element->children() as $option) {
// Only add <option /> elements.
if ($option->getName() !== 'option') {
continue;
}
// Create a new option object based on the <option /> element.
$options[] = HTMLHelper::_('select.option', (string) $option['value'], Text::alt(trim((string) $option), preg_replace('/[^a-zA-Z0-9_\\-]/', '_', $this->fieldname)), 'value', 'text');
}
return $options;
}