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


PHP Object::__call方法代码示例

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


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

示例1: __call

 /**
  * Calls the named method which is not a class method.
  *
  * Do not call this method directly as it is a PHP magic method that
  * will be implicitly called when an unknown method is being invoked.
  * @param string $method the method name
  * @param array $params method parameters
  * @throws UnknownMethodException when calling unknown method
  * @return mixed the method return value
  */
 public function __call($method, $params)
 {
     // TODO: Change the autogenerated stub
     if (method_exists($this->instance, $method)) {
         return call_user_func_array([$this->instance, $method], $params);
     }
     parent::__call($method, $params);
 }
开发者ID:TeoChoi,项目名称:yii2-hashids,代码行数:18,代码来源:Transfer.php

示例2: __call

 public function __call($name, $parameters)
 {
     // check methods of xs
     if ($this->xs !== null && method_exists($this->xs, $name)) {
         return call_user_func_array(array($this->xs, $name), $parameters);
     }
     // check methods of index object
     if ($this->xs !== null && method_exists(__NAMESPACE__ . '\\XSIndex', $name)) {
         $ret = call_user_func_array(array($this->xs->index, $name), $parameters);
         if ($ret === $this->xs->index) {
             return $this;
         }
         return $ret;
     }
     // check methods of search object
     if ($this->xs !== null && method_exists(__NAMESPACE__ . '\\XSSearch', $name)) {
         $ret = call_user_func_array(array($this->xs->search, $name), $parameters);
         if ($ret === $this->xs->search) {
             return $this;
         }
         return $ret;
     }
     return parent::__call($name, $parameters);
 }
开发者ID:chenyongze,项目名称:yii2-xunsearch,代码行数:24,代码来源:Database.php

示例3: __call

 /**
  * Calls the named method which is not a class method.
  *
  * Do not call this method directly as it is a PHP magic method that
  * will be implicitly called when an unknown method is being invoked.
  *
  * @param string $name the method name
  * @param array $arguments method parameters
  *
  * @return mixed the method return value
  */
 public function __call($name, $arguments)
 {
     if ($name === 'default') {
         return call_user_func_array([$this, '_default'], $arguments);
     }
     return parent::__call($name, $arguments);
 }
开发者ID:wozhen,项目名称:yii2-cms-writedown,代码行数:18,代码来源:SchemaBuilder.php

示例4: __call

 /**
  * @param string $name
  * @param array $params
  * @return mixed
  */
 public function __call($name, $params)
 {
     $property = lcfirst(substr($name, 3));
     if (substr($name, 0, 3) === 'get') {
         if (isset($this->params[$property])) {
             return $this->params[$property];
         } elseif (isset($params[0])) {
             return $params[0];
         }
     } elseif (substr($name, 0, 3) === 'has') {
         return isset($this->params[$property]);
     }
     return parent::__call($name, $params);
 }
开发者ID:dlds,项目名称:yii2-payment,代码行数:19,代码来源:Transaction.php


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