コード例 #1
0
ファイル: Facade.class.php プロジェクト: evilgeny/bob
 /**
  * Executes load<Entity>ById || get<Entity>List methods
  **/
 public function __call($method, $args)
 {
     if (preg_match('/load(\\w+)ById/', $method, $match)) {
         return $this->_mapper->loadById(strtolower($match[1]), $args[0]);
     } else {
         if (preg_match('/get(\\w+)List/', $method, $match)) {
             return $this->_mapper->getList(strtolower($match[1]));
         } else {
             throw new Exception("Unknown method `{$method}'");
         }
     }
 }