Get select options as array

@return array
14638
public function getOptionsAsArray()
    {
        $options      = $this->getOptions();
        $optionsArray = [];
        foreach ($options as $option) {
            $optionsArray[$option->getValue()] = $option->getNodeValue();
        }
        return $optionsArray;
    }
226338
protected function getOptions()
    {
        $options = array();

        foreach ($this->getRoutes() as $route)
        {
            // Create a new option object based on the <option /> element.
            $tmp = \JHtml::_(
                'select.option', $route,
                \JText::_(trim((string) $route)), 'value', 'text'
            );

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

        reset($options);

        return $options;
    }
548563
public function ToArray()
    {
        $result = array();
        $option = $this->TopMost();
        while ($option)
        {
            $result[$option->GetValue()] = $option->GetText();
            $option = $this->NextOf($option);
        }
        return $result;
    }
635600
public function getOptionArray()
    {
        // Prepare the options array
        $options = [];

        // Get the customer id 
        // TODO get from model or user select
        $customerId = 2;

        // Get the cards list
        $cardList = $this->paymentTokenManagement->getListByCustomerId($customerId);

        // Prepare the options list
        foreach ($cardList as $card) {
            // Get the card data
            $cardData = $card->getData();

            // Create the option
            //if ((int) $cardData->is_active == 1 && (int) $cardData->is_visible == 1) {
            if ($cardData) {
                $options[$cardData['gateway_token']] = $this->_getOptionString(json_decode($cardData['details']));
            }
        }

        return $options;
    }
31035
public function __toArray()
    {
        $data = array();

        foreach (static::schema() as $field => $options) {
            $data[$field] = $this->{$field};
        }

        return $data;
    }
1109950
public function getOptions()
    {
        $options = array();
        foreach ($this->commandOptions as $key => $value) {
            $options[$key]=$this->$value;
        }
        return $options;
    }
304268
public function _getOptions()
    {
        $opts = array();
        if (!empty($this->where))
        {
            $opts['where'] = $this->where;
        }
        if (count($this->includes))
        {
            $opts['include'] = join(',', $this->includes);
        }
        if (count($this->selectedKeys))
        {
            $opts['keys'] = join(',', $this->selectedKeys);
        }
        if ($this->limit >= 0)
        {
            $opts['limit'] = $this->limit;
        }
        if ($this->skip > 0)
        {
            $opts['skip'] = $this->skip;
        }
        if ($this->orderBy)
        {
            $opts['order'] = join(',', $this->orderBy);
        }
        if ($this->count)
        {
            $opts['count'] = $this->count;
        }

        return $opts;
    }
1217573
public function getOptions()
    {
        $returnArray = [];
        foreach ($this->commandOptions as $option) {
            $returnArray[$option->getName()] = $this->getOption($option->getName());
        }
        return $returnArray;
    }
924114
private function getOptions(): array
    {
        return $this->options + [
            PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_OBJ,
            PDO::ATTR_CASE => PDO::CASE_NATURAL,
            PDO::ATTR_ORACLE_NULLS => PDO::NULL_NATURAL,
            PDO::ATTR_STRINGIFY_FETCHES => false,
            PDO::ATTR_EMULATE_PREPARES => false,
        ];
    }
1006178
public function getOptions()
    {
        $res = [];
        foreach ($this->getOptionArray() as $index => $value) {
            $res[] = ['value' => $index, 'label' => $value];
        }
        return $res;
    }
985434
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.
			$tmp = HtmlSelect::option(
				(string) $option['value'], 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 object to the result set.
			$options[] = $tmp;
		}

		reset($options);

		return $options;
	}
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;
    }
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;
	}
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;
	}
540882
public function toOptionArray()
    {
        $options = [];
        foreach ($this->getContainers() as $container) {
            if (isset($container['type']) && ($container['type'] === self::TYPE_PRODUCT)) {
                $options[] = [
                    'value'    => $container['name'],
                    'label'    => __($container['label']),
                    'fulltext' => isset($container['fulltext']) && $container['fulltext'] == "true" ? true : false,
                ];
            }
        }

        return $options;
    }
483216
public function getOptions()
    {
        $options = [];
        foreach ($this->options as $name => $option) {
            $options[$name] = $option->getValue();
        }

        return $options;
    }
615168
private function getWrappedOptions()
    {
        $ret = [];
        foreach (array_keys($this->options) as $option) {
            $ret[] = var_export($option, true);
        }
        return $ret;
    }