You are here

private function QueryPath::getNthMatch in QueryPath 6

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

File

QueryPath/QueryPath.php, line 1923

Class

QueryPath

Code

private function getNthMatch($index) {
  if ($index > $this->matches
    ->count() || $index < 0) {
    return;
  }
  $i = 0;
  foreach ($this->matches as $m) {
    if ($i++ == $index) {
      return $m;
    }
  }
}