You are here

public function QueryPath::eachLambda in QueryPath 6

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

File

QueryPath/QueryPath.php, line 623

Class

QueryPath

Code

public function eachLambda($lambda) {
  $index = 0;
  foreach ($this->matches as $item) {
    $fn = create_function('$index, &$item', $lambda);
    if ($fn($index, $item) === FALSE) {
      return $this;
    }
    ++$index;
  }
  return $this;
}