You are here

public function QueryPath::filter in QueryPath 6

Same name and namespace in other branches
  1. 7.3 QueryPath/QueryPath.php \QueryPath::filter()
  2. 7.2 QueryPath/QueryPath.php \QueryPath::filter()
2 calls to QueryPath::filter()
QueryPath::children in QueryPath/QueryPath.php
QueryPath::siblings in QueryPath/QueryPath.php

File

QueryPath/QueryPath.php, line 469

Class

QueryPath

Code

public function filter($selector) {
  $found = new SplObjectStorage();
  foreach ($this->matches as $m) {
    if (qp($m, NULL, $this->options)
      ->is($selector)) {
      $found
        ->attach($m);
    }
  }
  $this
    ->setMatches($found);
  return $this;
}