Method to get the field option groups.

@return  array  The field option objects as a nested array in groups.

@since   1.0
@throws  UnexpectedValueException
507264
protected function getGroups()
	{
		$groups = array();
		$label = 0;

		foreach ($this->element->children() as $element)
		{
			switch ($element->getName())
			{
				// The element is an <option />
				case 'option':
					// Initialize the group if necessary.
					if (!isset($groups[$label]))
					{
						$groups[$label] = array();
					}

					// Create a new option object based on the <option /> element.
					$tmp = HtmlSelect::option(
						($element['value']) ? (string) $element['value'] : trim((string) $element),
						Text::alt(trim((string) $element), preg_replace('/[^a-zA-Z0-9_\-]/', '_', $this->fieldname)), 'value', 'text',
						((string) $element['disabled'] == 'true')
					);

					// Set some option attributes.
					$tmp->class = (string) $element['class'];

					// Set some JavaScript option attributes.
					$tmp->onclick = (string) $element['onclick'];

					// Add the option.
					$groups[$label][] = $tmp;
					break;

				// The element is a <group />
				case 'group':
					// Get the group label.
					if ($groupLabel = (string) $element['label'])
					{
						$label = Text::_($groupLabel);
					}

					// Initialize the group if necessary.
					if (!isset($groups[$label]))
					{
						$groups[$label] = array();
					}

					// Iterate through the children and build an array of options.
					foreach ($element->children() as $option)
					{
						// Only add <option /> elements.
						if ($option->getName() != 'option')
						{
							continue;
						}

						// Create a new option object based on the <option /> element.
						$tmp = HtmlSelect::option(
							($option['value']) ? (string) $option['value'] : Text::_(trim((string) $option)),
							Text::_(trim((string) $option)), 'value', 'text', ((string) $option['disabled'] == 'true')
						);

						// Set some option attributes.
						$tmp->class = (string) $option['class'];

						// Set some JavaScript option attributes.
						$tmp->onclick = (string) $option['onclick'];

						// Add the option.
						$groups[$label][] = $tmp;
					}

					if ($groupLabel)
					{
						$label = count($groups);
					}
					break;

				// Unknown element type.
				default:
					throw new UnexpectedValueException(sprintf('Unsupported element %s in JFormFieldGroupedList', $element->getName()), 500);
			}
		}

		reset($groups);

		return $groups;
	}
299867
public java.util.List<OptionGroupMembership> getOptionGroupMemberships() {
        if (optionGroupMemberships == null) {
            optionGroupMemberships = new com.amazonaws.internal.SdkInternalList<OptionGroupMembership>();
        }
        return optionGroupMemberships;
    }
1012449
private function getSortFieldChoices()
    {
        $choices = [];
        foreach ($this->getSortFieldValues() as $sortField) {
            $choices[$this->getSortFieldLabel($sortField)] = $sortField;
        }

        return $choices;
    }
911465
protected function options()
    {
        $types  = FieldType::all(['id', 'name', 'type']);
        $return = [];
        foreach ($types as $type) {
            $return[$type->id] = ucfirst(Str::humanize(is_null($type->type) ? $type->name : $type->name . ' ' . $type->type));
        }
        return $return;
    }
1238844
protected function getOptions()
	{
		$options = array();

		$select = new HtmlSelect;

		// Try to inject the text object into the field
		try
		{
			$select->setText($this->getText());
		}
		catch (\RuntimeException $exception)
		{
			// A Text object was not set, ignore the error and try to continue processing
		}

		/** @var \SimpleXMLElement $option */
		foreach ($this->element->children() as $option)
		{
			// Only add <option /> elements.
			if ($option->getName() != 'option')
			{
				continue;
			}

			$text = $this->translateOptions
				? $this->getText()->alt(trim((string) $option), preg_replace('/[^a-zA-Z0-9_\-]/', '_', $this->fieldname))
				: trim((string) $option);

			// Create a new option object based on the <option /> element.
			$tmp = $select->option((string) $option['value'], $text, 'value', 'text', ((string) $option['disabled'] == 'true'));

			// Set some option attributes.
			$tmp->class = (string) $option['class'];

			// Set some JavaScript option attributes.
			$tmp->onclick = (string) $option['onclick'];

			// Add the option object to the result set.
			$options[] = $tmp;
		}

		reset($options);

		return $options;
	}
1058570
public function getOptions()
    {
        $result = [];

        foreach ($this->options as $option) {
            $value = $option->getValue();
            if ($value !== null) {
                $result[$option->getShort() ?: $option->getLong()] = $value;
                if ($short = $option->getShort()) {
                    $result[$short] = $value;
                }
                if ($long = $option->getLong()) {
                    $result[$long] = $value;
                }
            }
        }

        return $result + $this->additionalOptions;
    }
506498
protected function _group()
    {
        $result = [];
        foreach ($this->_parts['group'] as $name => $value) {
            $result[] = $this->dialect()->name($name);
        }
        return $fields = join(', ', $result);
    }
306728
public function getFieldTypes()
    {
        $fields = [];
        foreach ($this->fields as $name => $value) {
            $fields[$name] = isset($this->types[$name])
                ? $this->types[$name]
                : null
                ;
        }

        return $fields;
    }
1195632
protected function getOptions()
	{
		$options = array();

		// Initialize some field attributes.
		$first = (int) $this->element['first'];
		$last = (int) $this->element['last'];
		$step = (int) $this->element['step'];

		// Sanity checks.
		if ($step == 0)
		{
			// Step of 0 will create an endless loop.
			return $options;
		}
		elseif ($first < $last && $step < 0)
		{
			// A negative step will never reach the last number.
			return $options;
		}
		elseif ($first > $last && $step > 0)
		{
			// A position step will never reach the last number.
			return $options;
		}
		elseif ($step < 0)
		{
			// Build the options array backwards.
			for ($i = $first; $i >= $last; $i += $step)
			{
				$options[] = HtmlSelect::option($i);
			}
		}
		else
		{
			// Build the options array.
			for ($i = $first; $i <= $last; $i += $step)
			{
				$options[] = HtmlSelect::option($i);
			}
		}

		// Merge any additional options in the XML definition.
		$options = array_merge(parent::getOptions(), $options);

		return $options;
	}
1094052
protected function getOptions()
	{
		$options = array();

		$select = new HtmlSelect;

		// Try to inject the text object into the field
		try
		{
			$select->setText($this->getText());
		}
		catch (\RuntimeException $exception)
		{
			// A Text object was not set, ignore the error and try to continue processing
		}

		// Initialize some field attributes.
		$filter = (string) $this->element['filter'];
		$exclude = (string) $this->element['exclude'];
		$hideNone = (string) $this->element['hide_none'];
		$hideDefault = (string) $this->element['hide_default'];

		// Get the path in which to search for file options.
		$path = (string) $this->element['directory'];

		if (!is_dir($path))
		{
			$path = JPATH_ROOT . '/' . $path;
		}

		// Prepend some default options based on field attributes.
		if (!$hideNone)
		{
			$text = $this->translateOptions
				? $this->getText()->alt('JOPTION_DO_NOT_USE', preg_replace('/[^a-zA-Z0-9_\-]/', '_', $this->fieldname))
				: '- None Selected -';

			$options[] = $select->option('-1', $text);
		}

		if (!$hideDefault)
		{
			$text = $this->translateOptions
				? $this->getText()->alt('JOPTION_USE_DEFAULT', preg_replace('/[^a-zA-Z0-9_\-]/', '_', $this->fieldname))
				: '- Use Default -';

			$options[] = $select->option('', $text);
		}

		// Get a list of folders in the search path with the given filter.
		$folders = Folder::folders($path, $filter);

		// Build the options list from the list of folders.
		if (is_array($folders))
		{
			foreach ($folders as $folder)
			{
				// Check to see if the file is in the exclude mask.
				if ($exclude)
				{
					if (preg_match(chr(1) . $exclude . chr(1), $folder))
					{
						continue;
					}
				}

				$options[] = $select->option($folder, $folder);
			}
		}

		// Merge any additional options in the XML definition.
		$options = array_merge(parent::getOptions(), $options);

		return $options;
	}
54147
public function getListOptionFields()
    {
        // Obtain Field Objects (from parent):
        
        $fields = parent::getListOptionFields();
        
        // Create Field Objects:
        
        $fields->merge([
            FieldSection::create(
                'MasonryOptions',
                $this->fieldLabel('MasonryOptions'),
                [
                    CheckboxField::create(
                        'HorizontalOrder',
                        $this->fieldLabel('HorizontalOrder')
                    )
                ]
            )
        ]);
        
        // Answer Field Objects:
        
        return $fields;
    }
1030818
public function getValues()
    {
        $values = array();

        foreach ($this->getFields() as $field) {
            $name = $field->getBaseName();
            $index = $field->getIndex();

            if ($index === null) {
                $values[$name] = $field->getValue();
            } else {
                if (!isset($values[$name])) {
                    $values[$name] = array();
                }

                if ($index) {
                    $value = &$values[$name];
                    foreach ($index as $part) {
                        if (!isset($value[$part])) {
                            $value[$part] = array();
                        }
                        $value = &$value[$part];
                    }
                    $value = $field->getValue();
                } else {
                    $values[$name][] = $field->getValue();
                }
            }
        }

        return $values;
    }
8968
public function getOptions()
    {
        // Loop through and figure out which values were selected.
        $options = array();
        $selectedValue = $this->getValueArray();
        foreach ($this->getSource() as $itemValue => $title) {
            $itemSelected = in_array($itemValue, $selectedValue)
                || in_array($itemValue, $this->getDefaultItems());
            $itemDisabled = $this->isDisabled()
                || in_array($itemValue, $this->getDisabledItems());
            $options[] = new ArrayData(array(
                'Title' => $title,
                'Value' => $itemValue,
                'Selected' => $itemSelected,
                'Disabled' => $itemDisabled,
            ));
        }

        $options = new ArrayList($options);
        $this->extend('updateGetOptions', $options);
        return $options;
    }
544046
public function getAll() : array
    {
        $fieldOptions = call_user_func($this->fieldOptionsLoader);
        TypeMismatchException::verifyAllInstanceOf(__METHOD__, '<return>', $fieldOptions, IFieldOption::class);
        return $fieldOptions;
    }
166133
public function getDatatypes() {
        if (empty($this->data)) {
            $this->data = $this->parse_string();
        }
        if (!is_array($this->data)) {
            throw new \UnexpectedValueException('No data set yet.');
        }

        $result = [];
        foreach ($this->titles as $cName) {
            $column = array_column($this->data, $cName);
            $cDatatypes = array_map(DatatypeEnum::class . '::getValidTypeFromSample', $column);

            $result[$cName] = $this->getMostFrequentDatatypeForColumn($cDatatypes);
        }

        $this->data_types = $result;

        return !empty($this->data_types) ? $this->data_types : [];
    }
134287
protected function getGroups()
	{
		// Initialize variables.
		$groups = array();
		$label = 0;

		foreach ($this->element->children() as $element)
		{
			switch ($element->getName())
			{
				// The element is an <option />
				case 'option':
					// Initialize the group if necessary.
					if (!isset($groups[$label]))
					{
						$groups[$label] = array();
					}

					// Create a new option object based on the <option /> element.
					$tmp = Dropdown::option(
						($element['value']) ? (string) $element['value'] : trim((string) $element),
						App::get('language')->alt(trim((string) $element), preg_replace('/[^a-zA-Z0-9_\-]/', '_', $this->fieldname)), 'value', 'text',
						((string) $element['disabled'] == 'true')
					);

					// Set some option attributes.
					$tmp->class = (string) $element['class'];

					// Set some JavaScript option attributes.
					$tmp->onclick = (string) $element['onclick'];

					// Add the option.
					$groups[$label][] = $tmp;
					break;

				// The element is a <group />
				case 'group':
					// Get the group label.
					if ($groupLabel = (string) $element['label'])
					{
						$label = App::get('language')->txt($groupLabel);
					}

					// Initialize the group if necessary.
					if (!isset($groups[$label]))
					{
						$groups[$label] = array();
					}

					// Iterate through the children and build an array of options.
					foreach ($element->children() as $option)
					{
						// Only add <option /> elements.
						if ($option->getName() != 'option')
						{
							continue;
						}

						// Create a new option object based on the <option /> element.
						$tmp = Dropdown::option(
							($option['value']) ? (string) $option['value'] : App::get('language')->txt(trim((string) $option)),
							App::get('language')->txt(trim((string) $option)), 'value', 'text', ((string) $option['disabled'] == 'true')
						);

						// Set some option attributes.
						$tmp->class = (string) $option['class'];

						// Set some JavaScript option attributes.
						$tmp->onclick = (string) $option['onclick'];

						// Add the option.
						$groups[$label][] = $tmp;
					}

					if ($groupLabel)
					{
						$label = count($groups);
					}
				break;

				// Unknown element type.
				default:
					App::abort(500, App::get('language')->txt('JLIB_FORM_ERROR_FIELDS_GROUPEDLIST_ELEMENT_NAME', $element->getName()));
				break;
			}
		}

		reset($groups);

		return $groups;
	}
981086
public function getOptions()
    {
        $options = [];
        foreach ($this->toOptionArray() as $values) {
            $options[$values['value']] = __($values['label']);
        }
        return $options;
    }