public function offsetExists($key) { if (is_int($key)) { return (bool) array_slice((array) $this, $key, 1); } return parent::offsetExists($key); }
/** * Returns the global configuration. * @param string key * @param mixed default value * @return mixed */ public static function getConfig($key = NULL, $default = NULL) { $params = NArrayHash::from(self::getContext()->parameters); if (func_num_args()) { return isset($params[$key]) ? $params[$key] : $default; } else { return $params; } }
public function getParams($vars) { if ($vars == NULL || count($vars) == 0) { return ""; } else { $arr = array(); foreach (NArrayHash::from($vars) as $key => $item) { if (is_numeric($key)) { $arr[] = "\${$item}"; } else { $arr[] = "\${$key} = " . $this->parseValue($item); } } return implode(', ', $arr); } }