コード例 #1
0
 public function __call($name, $parameters)
 {
     if (\method_exists($this->_imageHandler, $name)) {
         return \call_user_func_array(array($this->_imageHandler, $name), $parameters);
     }
     return parent::__call($name, $parameters);
 }
コード例 #2
0
ファイル: MailgunYii.php プロジェクト: newga/newga
 public function __call($name, $parameters)
 {
     if (method_exists($this->_api, $name)) {
         return call_user_func_array(array($this->_api, $name), $parameters);
     }
     return parent::__call($name, $parameters);
 }
コード例 #3
0
ファイル: SystemDaemon.php プロジェクト: d4rkstar/yii-daemon
 /**
  * Any requests to set or get attributes or call methods on this class that
  * are not found are redirected to the {@link System_Daemon} object.
  *
  * @param string $name the method name
  * @param array $parameters
  * @return mixed
  */
 public function __call($name, $parameters)
 {
     if (method_exists('System_Daemon', $name)) {
         return call_user_func_array(array('System_Daemon', $name), $parameters);
     } else {
         return parent::__call($name, $parameters);
     }
 }
コード例 #4
0
 /**
  * Calls the format method when its shortcut is invoked.
  * This is a PHP magic method that we override to implement the shortcut format methods.
  * @param string the method name
  * @param array method parameters
  * @return mixed the method return value
  */
 public function __call($name, $parameters)
 {
     if (method_exists($this, 'format' . $name)) {
         return call_user_func_array(array($this, 'format' . $name), $parameters);
     } else {
         return parent::__call($name, $parameters);
     }
 }
コード例 #5
0
 /**
  * @inheritdoc
  */
 public function __call($name, $parameters)
 {
     $callable = [$this->_commandBus, $name];
     if (is_callable($callable)) {
         return call_user_func_array($callable, $parameters);
     } else {
         // if $name is not function of CommandBus,
         // just use regular Yii methods to handle __call
         return parent::__call($name, $parameters);
     }
 }
コード例 #6
0
ファイル: EGeocoder.php プロジェクト: mafiu/listapp
 /**
  * @param string $name
  * @param array $params
  * @return mixed
  */
 public function __call($name, $params)
 {
     // just to make sure ;-)
     if (!$this->getIsInitialized()) {
         $this->init();
     }
     if (method_exists($this->_geocoder, $name)) {
         return call_user_func_array(array($this->_geocoder, $name), $params);
     }
     return parent::__call($name, $params);
 }
コード例 #7
0
 public function __call($name, $params)
 {
     try {
         return parent::__call($name, $params);
     } catch (CException $e) {
         if (method_exists($this->morphy, $name)) {
             return call_user_func_array(array($this->morphy, $name), $params);
         } else {
             throw $e;
         }
     }
 }
コード例 #8
0
ファイル: EXunSearch.php プロジェクト: Kuner/xunsearch
 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('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('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);
 }
コード例 #9
0
ファイル: EMongoClient.php プロジェクト: yiicod/mongoyii
 /**
  * Will call a function on the database or error out stating that the function does not exist
  * @param string $name
  * @param array $parameters
  * @return mixed
  */
 public function __call($name, $parameters = [])
 {
     if (!method_exists($this->getDB(), $name)) {
         return parent::__call($name, $parameters);
     }
     return call_user_func_array([$this->getDB(), $name], $parameters);
 }
コード例 #10
0
ファイル: DGSphinxSearch.php プロジェクト: zwq/unpei
 /**
  * @brief magic for wrap SphinxClient functions
  * @param string $name
  * @param array $parameters
  * @return DGSphinxSearch
  */
 public function __call($name, $parameters)
 {
     $res = null;
     if (method_exists($this->client, $name)) {
         $res = call_user_func_array(array($this->client, $name), $parameters);
     } else {
         $res = parent::__call($name, $parameters);
     }
     // if setter or resetter then return chain
     if (strtolower(substr($name, 0, 3)) === 'set' || strtolower(substr($name, 0, 5)) === 'reset') {
         $res = $this;
     }
     return $res;
 }
コード例 #11
0
ファイル: EasyUpyun.php プロジェクト: xbb123/yiiextension
 /**
  * @param string $name
  * @param array  $paramaters
  *
  * @return mixed
  */
 public function __call($name, $paramaters)
 {
     $domain = array_shift($paramaters);
     $upyun = $this->getBucketInfo($domain);
     if (method_exists($upyun, $name)) {
         return call_user_func_array(array($upyun, $name), $paramaters);
     }
     return parent::__call($name, $paramaters);
 }
コード例 #12
0
 /**
  *
  * @param string $name
  * @param array $params
  * @return mixed
  */
 public function __call($name, $params)
 {
     $redisCommand = strtoupper(self::camel2words($name, false));
     if (in_array($redisCommand, $this->redisCommands)) {
         return $this->executeCommand($name, $params);
     } else {
         return parent::__call($name, $params);
     }
 }