public static function camelCaseToDelimiter($string, $delimiter = '-') { return strtolower(preg_replace('/([A-Z])/', "{$delimiter}\\1", $string)); }
private function _underscoreKeys($array) { foreach ($array as $key => $value) { $newKey = Util::camelCaseToDelimiter($key, '_'); unset($array[$key]); if (is_array($value)) { $array[$newKey] = $this->_underscoreKeys($value); } else { $array[$newKey] = $value; } } return $array; }