Ejemplo n.º 1
0
 function __call($method, $args)
 {
     if ($this->connection) {
         return call_user_func_array(array($this->connection, $method), $args);
     }
     undefined_method($method, get_called_class());
 }
Ejemplo n.º 2
0
 public function __call($method, $args)
 {
     // Look up relationships in the cache
     if (preg_match('/^get(.+)/', $method, $matches)) {
         $key = strtolower($matches[1]);
         if (isset($this->relations[$key])) {
             return $this->getRelationship($key);
         }
     }
     undefined_method($method, get_called_class());
 }