You are here

public function QueryPath::get in QueryPath 6

Same name and namespace in other branches
  1. 7.3 QueryPath/QueryPath.php \QueryPath::get()
  2. 7.2 QueryPath/QueryPath.php \QueryPath::get()
1 call to QueryPath::get()
QueryPath::toArray in QueryPath/QueryPath.php

File

QueryPath/QueryPath.php, line 302

Class

QueryPath

Code

public function get($index = NULL, $asObject = FALSE) {
  if (isset($index)) {
    return $this
      ->size() > $index ? $this
      ->getNthMatch($index) : NULL;
  }
  if (!$asObject) {
    $matches = array();
    foreach ($this->matches as $m) {
      $matches[] = $m;
    }
    return $matches;
  }
  return $this->matches;
}