コード例 #1
0
ファイル: sfMixerTest.php プロジェクト: sensorsix/app
 function __call($method, $arguments)
 {
     $r = "before __call\n";
     $r .= sfMixer::callMixins();
     $r .= "after __call\n";
     return $r;
 }
コード例 #2
0
 public function __call($name, $arguments)
 {
     if (strpos($name, 'get') === 0) {
         $key = strtolower(preg_replace('/^get/', '', $name, 1));
         return $this->storage->get($key);
         //todo allow backfetching?
     } elseif (strpos($name, 'set') === 0 && array_key_exists(0, $arguments)) {
         $key = strtolower(preg_replace('/^set/', '', $name, 1));
         return $this->storage->set($key, $arguments[0]);
         // forgot the return here
     } elseif (strpos($name, 'has') === 0) {
         $key = strtolower(preg_replace('/^has/', '', $name, 1));
         return $this->storage->has($key);
     }
     return sfMixer::callMixins();
     // We're going to need mixin support
 }
コード例 #3
0
 /**
  * Hook for sfMixer
  */
 public function __call($a, $b)
 {
     return sfMixer::callMixins();
 }
コード例 #4
0
 /**
  * Adapts the ->getXXX() methods to solr.
  */
 public function __call($method, $args = array())
 {
     if (substr($method, 0, 3) == 'get') {
         return $this->result->__get($this->getProperty($method, 'get'));
     } elseif (substr($method, 0, 3) == 'has') {
         try {
             $this->result->__get($this->getProperty($method, 'has'));
             return true;
         } catch (Exception $e) {
             return false;
         }
     }
     $call = array($this->result, $method);
     if (is_callable($call)) {
         return call_user_func_array($call, $args);
     }
     return sfMixer::callMixins();
 }