本文整理匯總了PHP中CComponent::__call方法的典型用法代碼示例。如果您正苦於以下問題:PHP CComponent::__call方法的具體用法?PHP CComponent::__call怎麽用?PHP CComponent::__call使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CComponent
的用法示例。
在下文中一共展示了CComponent::__call方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: __call
public function __call($name, $parameters)
{
if (false !== $this->getIsProxy() && false !== method_exists($this->_instance, $name)) {
return call_user_func_array(array($this->_instance, $name), $parameters);
}
return parent::__call($name, $parameters);
}
示例2: __call
/**
* Any requests to set or get attributes or call methods on this class that are not found are redirected to the Swift_Message object
* @param string the method name
*/
public function __call($name, $parameters)
{
try {
return parent::__call($name, $parameters);
} catch (CException $e) {
if (method_exists($this->message, $name)) {
return call_user_func_array(array($this->message, $name), $parameters);
} else {
throw $e;
}
}
}
示例3: __call
/**
* Magic call to wrapped amazon aws methods. If not command found, then call parent component
* @param string $method
* @param array $args
* @return mixed
* @throws CException
*/
public function __call($method, $args)
{
// the "current" is nessesary here:
if ($args == false) {
$args = array();
} else {
$args = current($args);
}
try {
$command = $this->getClient()->getCommand(Inflector::getDefault()->camel($method), $args);
if ($command) {
return $this->getClient()->execute($command, $args);
}
} catch (Exception $e) {
// do nothing
throw new CException(Yii::t('zii', $e->getMessage()));
//custom added
}
return parent::__call($method, $args);
}
示例4: __call
/**
* If we have operator add it otherwise call parent implementation
* @see CComponent::__call()
* @since v1.0
*/
public function __call($fieldName, $parameters)
{
if (isset($parameters[0])) {
$operatorName = strtolower($parameters[0]);
}
if (isset($parameters[1]) || $parameters[1] === null) {
$value = $parameters[1];
}
if (is_numeric($operatorName)) {
$operatorName = strtolower(trim($value));
$value = strtolower(trim($value)) === 'exists' ? true : false;
}
if (in_array($operatorName, array_keys(self::$operators))) {
array_push($this->_workingFields, $fieldName);
$fieldName = implode('.', $this->_workingFields);
$this->_workingFields = array();
switch ($operatorName) {
case 'exists':
$this->addCond($fieldName, $operatorName, true);
break;
case 'notexists':
$this->addCond($fieldName, $operatorName, false);
break;
default:
$this->addCond($fieldName, $operatorName, $value);
}
return $this;
} else {
return parent::__call($fieldName, $parameters);
}
}
示例5: __call
/**
* (non-PHPdoc)
* @see CComponent::__call()
*/
public function __call($name, $parameters = array())
{
if (!array_key_exists($name, $this->supportedMethods)) {
return parent::__call($name, $parameters);
}
$count = count($parameters);
$result = $this->_request($name, $count ? $parameters[0] : array());
$this->_results = $result;
$this->_checkResponse();
if (isset($this->supportedMethods[$name]['root'])) {
$this->_parseRoot($this->supportedMethods[$name]['root']);
}
// returns as array
return $result;
}