示例#1
0
 function __call($key, $args)
 {
     if (empty($args)) {
         return parent::__call($key, $args);
     } else {
         if (!method_exists($this, $methodname = 'get_' . $key)) {
             return false;
         } else {
             $key = $key . ':' . serialize($args);
             if (isset($this->_method_cache[$key])) {
                 return $this->_method_cache[$key];
             } else {
                 if (empty($args)) {
                     return $this->_method_cache[$key] = $this->{$methodname}();
                 } else {
                     return $this->_method_cache[$key] = call_user_func_array(array($this, 'get_' . $methodname), $args);
                 }
             }
         }
     }
 }