return option as assoc array (name=>count).

@return array
192695
public function GetOptions()
    {
        $aOptions = $this->GetFromInternalCache('aOptions');
        if (is_null($aOptions)) {
            $aOptions = array();

            // we only care for the max and min value...
            $sIdSelect = $this->GetResultSetBaseQuery();

            $query = "SELECT MAX(`price`) AS maxprice, MIN(`price`) AS minprice
                    FROM `shop_article`
              INNER JOIN ({$sIdSelect}) AS Z ON `shop_article`.`id` = Z.`id`
                 ";

            if ($aValues = MySqlLegacySupport::getInstance()->fetch_assoc(MySqlLegacySupport::getInstance()->query($query))) {
                if ($aValues['minprice'] > 0) {
                    $aOptions[$aValues['minprice']] = 1;
                }
                if ($aValues['maxprice'] > 0) {
                    $aOptions[$aValues['maxprice']] = 1;
                }
            }
            $this->SetInternalCache('aOptions', $aOptions);
        }

        return $aOptions;
    }
1203111
public function toOptionArray()
    {
        if ($this->options !== null) {
            return $this->options;
        }

        $this->currentOptions['All Store Views']['label'] = __('All Store Views');
        $this->currentOptions['All Store Views']['value'] = self::ALL_STORE_VIEWS;

        $this->generateCurrentOptions();

        $this->options = array_values($this->currentOptions);

        return $this->options;
    }
487400
public function toArray()
    {
        return [
            'hard_quota' => $this->getHardQuota(),
            'soft_quota' => $this->getSoftQuota(),
            'soft_quota_percent' => $this->getSoftQuotaPercent(),
            'usage' => $this->getUsage(),
            'usage_percent' => $this->getUsagePercent(),
            'remaining_soft_quota' => $this->getRemainingSoftQuota(),
            'remaining_soft_quota_percent' => $this->getRemainingSoftQuotaPercent(),
            'remaining_hard_quota' => $this->getRemainingHardQuota(),
            'remaining_hard_quota_percent' => $this->getRemainingHardQuotaPercent(),
        ];
    }
902570
public function toOptionArray()
    {
        $result = $row = [];
        $i = 0;
        foreach ($this->times as $one) {
            if ($i == 0) {
                $row = [
                    'value' => $one,
                    'label' => $one . __(' Hour'),
                ];
            } else {
                $row = [
                    'value' => $one,
                    'label' => $one . __(' Hours'),
                ];
            }
            $result[] = $row;
            ++$i;
        }

        return $result;
    }
506878
public function getMultioptions()
    {
        $array = [];
        foreach ((new \Cms\Orm\CmsTagQuery)->orderAscId()->findPairs('tag', 'tag') as $k => $t) {
            $array[$k] = $k;
        }

        return array_merge($this->getValue(), $array);
    }
773586
public function toArray()
    {
        $options = $this->options;

        if ($this->Default) {
            $options = array_merge($this->Default->options, $options);
        }

        ksort($options);

        return $options;
    }
1180805
public function asArray()
    {
		if (func_num_args() == 0) {
			$fields = array('id');
		}
		else {
			$fields = array();
			$args = func_get_args();
			if (count($args)==1 && is_array($args[0])) {
				$args = $args[0];
			}			
			foreach ($args as $f ) {
				if (is_string($f)) $fields[] = $f;
			}
		}
		
		$obj = array();
		foreach ($fields as $f) {
			$obj[$f] = $this->$f;
		}
		return $obj;
    }
710162
public function asArray()
    {
        $fields = [
            '@type' => $this->type(),
            '@key'  => $this->key(),
        ];

        foreach ($this->fields as $name => $field) {
            $fields[$name] = $field->value;
        }

        return $fields;
    }
227006
public function getDiscounts()
    {
        if ($this->getTotalDiscount() && $this->getTotalDiscount()->getBruttoPrice() == 0 && count($this->_aItemDiscounts) == 0) {
            return [];
        }

        return array_merge($this->_aItemDiscounts, $this->_aDiscounts);
    }
1096182
public function toOptionArray()
    {
        $options = [];
        //exclude attributes from mapping
        $excluded = [
            'created_at',
            'created_in',
            'dob',
            'dotmailer_contact_id',
            'email',
            'firstname',
            'lastname',
            'gender',
            'group_id',
            'password_hash',
            'prefix',
            'rp_token',
            'rp_token_create_at',
            'website_id',
        ];
        $attributes = $this->customerFactory->create()
            ->getAttributes();

        foreach ($attributes as $attribute) {
            if ($attribute->getFrontendLabel()) {
                $code = $attribute->getAttributeCode();
                //escape the label in case of quotes
                $label = $this->escaper->escapeQuote($attribute->getFrontendLabel());
                if (!in_array($code, $excluded)) {
                    $options[] = [
                        'value' => $attribute->getAttributeCode(),
                        'label' => $label,
                    ];
                }
            }
        }

        return $options;
    }
17957
public function toOptionArray()
    {
        if (null === $this->options) {
            $collection = $this->collectionFactory->create();
            $collection->addFieldToFilter('is_active', 1);
            $collection->setOrder('identifier', \Magento\Framework\Data\Collection::SORT_ORDER_ASC);

            $options = [
                [
                    'value' => '',
                    'label' => __('-- No Page --')
                ]
            ];

            foreach ($collection as $item) {
                /** @var \Magento\Cms\Model\Page $item */
                $options[] = [
                    'value' => $item->getIdentifier(),
                    'label' => $item->getTitle()
                ];
            }

            $this->options = $options;
        }

        return $this->options;
    }
1298730
public function toArray()
    {
        $values = $this->values;
        return array_map(
            function ($cursor) use ($values) {
                return $values[$cursor];
            },
            $this->nameToCursor
        );
    }
1114862
public function toOptionArray()
    {
        $fields = [];
        //default data option
        $fields[] = ['value' => '0', 'label' => '-- Please Select --'];
        $websiteId = $this->helper->getWebsiteForSelectedScopeInAdmin()->getId();
        $apiEnabled = $this->helper->isEnabled($websiteId);
        if ($apiEnabled) {
            $savedDatafields = $this->registry->registry('datafields');

            //get saved datafileds from registry
            if ($savedDatafields) {
                $datafields = $savedDatafields;
            } else {
                //grab the datafields request and save to register
                $client = $this->helper->getWebsiteApiClient($websiteId);
                $datafields = $client->getDatafields();
                $this->registry->unregister('datafields'); // additional measure
                $this->registry->register('datafields', $datafields);
            }

            //set the api error message for the first option
            if (isset($datafields->message)) {
                //message
                $fields[] = [
                    'value' => 0,
                    'label' => $datafields->message,
                ];
            } else {
                //loop for all datafields option
                foreach ($datafields as $datafield) {
                    if (isset($datafield->name)) {
                        $fields[] = [
                            'value' => $datafield->name,
                            'label' => $datafield->name,
                        ];
                    }
                }
            }
        }

        return $fields;
    }
1303705
protected function getOptionWordsWithValues()
    {
        $strings = array();

        foreach ($this->getAllOptions() as $option) {
            if ($option->isValueRequired()) {
                $strings[] = '--' . $option->getName();

                if ($option->getShortcut()) {
                    $strings[] = '-' . $option->getShortcut();
                }
            }
        }

        return $strings;
    }
69316
public function toOptionArray()
    {
        if ($this->options !== null) {
            return $this->options;
        }

        $this->generateCurrentOptions();

        $this->options = array_values($this->currentOptions);

        return $this->options;
    }
865090
public function toOptionArray()
    {
        return [
            ['value' => BucketInterface::SORT_ORDER_COUNT, 'label' => __('Result count')],
            ['value' => BucketInterface::SORT_ORDER_MANUAL, 'label' => __('Admin sort')],
            ['value' => BucketInterface::SORT_ORDER_TERM, 'label' => __('Name')],
            ['value' => BucketInterface::SORT_ORDER_RELEVANCE, 'label' => __('Relevance')],
        ];
    }
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;
    }