You are here

public function QueryPath::__call in QueryPath 6

Same name and namespace in other branches
  1. 7.3 QueryPath/QueryPath.php \QueryPath::__call()
  2. 7.2 QueryPath/QueryPath.php \QueryPath::__call()

File

QueryPath/QueryPath.php, line 2020

Class

QueryPath

Code

public function __call($name, $arguments) {
  if (!QueryPathExtensionRegistry::$useRegistry) {
    throw new QueryPathException("No method named {$name} found (Extensions disabled).");
  }
  if (empty($this->ext)) {
    $this->ext = QueryPathExtensionRegistry::getExtensions($this);
  }
  if (!empty($this->ext) && QueryPathExtensionRegistry::hasMethod($name)) {
    $owner = QueryPathExtensionRegistry::getMethodClass($name);
    $method = new ReflectionMethod($owner, $name);
    return $method
      ->invokeArgs($this->ext[$owner], $arguments);
  }
  throw new QueryPathException("No method named {$name} found. Possibly missing an extension.");
}