/** * Create array with all columns types. * * @param array[]|ColumnMetadata $properties The metadata of the column. * @param null|string $typePrefix Prefix for column type name. */ public function extendColumnTypes($properties, $typePrefix) { $columnTypes = $properties->getProperties(); foreach ($columnTypes as $typeName => $typeValue) { if ($typeName == 'column_name') { if (!isset($this->columnTypes['column_name'])) { $this->columnTypes[$typeName] = $typeValue; } } else { $format = '%s_%s'; if (isset($typePrefix)) { $this->columnTypes[sprintf($format, $typePrefix, $typeName)] = $typeValue; } else { $this->columnTypes[$typeName] = $typeValue; } } } }
/** * @param \ArrayObject|array[] $currencies */ protected function setCurrencies($currencies) { $this->currencies = $currencies; if ($currencies->count()) { foreach ($currencies as $currency) { $this->currenciesOptimized[$currency['id']] = $currency['value']; } } }
/** * @param ResultSet|array[] $cities * @return array */ private function getCityListAsArray($cities) { $cityList = ['-- All Cities --']; if ($cities->count()) { foreach ($cities as $city) { $cityList[$city['id']] = $city['name']; } } return $cityList; }