/** * @return array */ private function getAsOptionArray() { if (!isset($this->_asOptionArray)) { /** @var array $optionCurrenciesAll */ $optionCurrenciesAll = Mage::app()->getLocale()->getOptionCurrencies(); df_assert_array($optionCurrenciesAll); /** @var array $optionCurrencyMap */ $optionCurrencyMap = array_combine(df_column($optionCurrenciesAll, 'value'), df_column($optionCurrenciesAll, 'label')); df_assert_array($optionCurrencyMap); /** @var array $result */ $result = array(); foreach (self::getAllowedCurrencies() as $currencyCode) { /** @var string $currencyCode */ /** @var string|null $label */ $label = df_a($optionCurrencyMap, $currencyCode); if (!is_null($label)) { $result[] = array('value' => $currencyCode, 'label' => $label); } } df_assert_array($result); $this->_asOptionArray = $result; } df_result_array($this->_asOptionArray); return $this->_asOptionArray; }
/** * 2015-12-30 * Преобразует коллекцию или массив в карту. * @param string|\Closure $method * @param \Traversable|array(int|string => DataObject) $items * @return mixed[] */ function df_index($method, $items) { return array_combine(df_column($items, $method), $items); }