当前位置: 首页>>代码示例>>PHP>>正文


PHP gapi::array_key_exists_nc方法代码示例

本文整理汇总了PHP中gapi::array_key_exists_nc方法的典型用法代码示例。如果您正苦于以下问题:PHP gapi::array_key_exists_nc方法的具体用法?PHP gapi::array_key_exists_nc怎么用?PHP gapi::array_key_exists_nc使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在gapi的用法示例。


在下文中一共展示了gapi::array_key_exists_nc方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __call

	/**
	 * Call method to find a matching parameter to return
	 *
	 * @param $name String name of function called
	 * @return String
	 * @throws Exception if not a valid parameter, or not a 'get' function
	 */
	public function __call($name,$parameters)
	{
		if(!preg_match('/^get/',$name))
		{
			throw new Exception('No such function "' . $name . '"');
		}
		
		$name = preg_replace('/^get/','',$name);
		
		$property_key = gapi::array_key_exists_nc($name,$this->properties);
		
		if($property_key)
		{
			return $this->properties[$property_key];
		}
		
		throw new Exception('No valid property called "' . $name . '"');
	}
开发者ID:rob-mccann,项目名称:fuel-gapi,代码行数:25,代码来源:accountentry.php

示例2: __call

 /**
  * Call method to find a matching metric or dimension to return
  *
  * @param $name String name of function called
  * @return String
  * @throws Exception if not a valid metric or dimensions, or not a 'get' function
  */
 public function __call($name, $parameters)
 {
     if (!preg_match('/^get/', $name)) {
         throw new Exception('No such function "' . $name . '"');
     }
     $name = preg_replace('/^get/', '', $name);
     $metric_key = gapi::array_key_exists_nc($name, $this->metrics);
     if ($metric_key) {
         return $this->metrics[$metric_key];
     }
     $dimension_key = gapi::array_key_exists_nc($name, $this->dimensions);
     if ($dimension_key) {
         return $this->dimensions[$dimension_key];
     }
     throw new Exception('No valid metric or dimesion called "' . $name . '"');
 }
开发者ID:rockst,项目名称:Google,代码行数:23,代码来源:gapi.class.php

示例3: __call

	/**
	 * Call method to find a matching root parameter or 
	 * aggregate metric to return
	 *
	 * @param $name String name of function called
	 * @return String
	 * @throws Exception if not a valid parameter or aggregate 
	 * metric, or not a 'get' function
	 */
	public function __call($name,$parameters)
	{
		if(!preg_match('/^get/',$name))
		{
			throw new \Exception('No such function "' . $name . '"');
		}
		
		$name = preg_replace('/^get/','',$name);
		
		$parameter_key = gapi::array_key_exists_nc($name,$this->report_root_parameters);
		
		if($parameter_key)
		{
			return $this->report_root_parameters[$parameter_key];
		}
		
		$aggregate_metric_key = gapi::array_key_exists_nc($name,$this->report_aggregate_metrics);
		
		if($aggregate_metric_key)
		{
			return $this->report_aggregate_metrics[$aggregate_metric_key];
		}

		throw new \Exception('No valid root parameter or aggregate metric called "' . $name . '"');
	}
开发者ID:rob-mccann,项目名称:fuel-gapi,代码行数:34,代码来源:gapi.php


注:本文中的gapi::array_key_exists_nc方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。