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);
 }
Exemple #2
0
 /**
  * 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;
         }
     }
 }
Exemple #3
0
 /**
  * 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);
 }
Exemple #4
0
 /**
  * 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);
     }
 }
 /**
  * (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;
 }