當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。