コード例 #1
0
ファイル: Facade.php プロジェクト: backplane/elastica
 /**
  * Executes DSL methods
  *
  * @throws QueryBuilderException
  *
  * @param  string $name
  * @param  array  $arguments
  * @return mixed
  */
 public function __call($name, array $arguments)
 {
     // defined check
     if (false === method_exists($this->_dsl, $name)) {
         throw new QueryBuilderException('undefined ' . $this->_dsl->getType() . ' "' . $name . '"');
     }
     // version support check
     if (false === $this->_version->supports($name, $this->_dsl->getType())) {
         $reflection = new \ReflectionClass($this->_version);
         throw new QueryBuilderException($this->_dsl->getType() . ' "' . $name . '" in ' . $reflection->getShortName() . ' not supported');
     }
     return call_user_func_array(array($this->_dsl, $name), $arguments);
 }
コード例 #2
0
 /**
  * Adds a new DSL object.
  *
  * @param DSL $dsl
  */
 public function addDSL(DSL $dsl)
 {
     $this->_facades[$dsl->getType()] = new Facade($dsl, $this->_version);
 }