QueryPath\DOMQuery::filter PHP Метод

filter() публичный Метод

Use this, for example, to find all elements with a class, or with certain children.
См. также: filterLambda()
См. также: filterCallback()
См. также: map()
См. также: find()
См. также: is()
public filter ( string $selector )
$selector string The selector to use as a filter.
    public function filter($selector)
    {
        $found = new \SplObjectStorage();
        $tmp = new \SplObjectStorage();
        foreach ($this->matches as $m) {
            $tmp->attach($m);
            // Seems like this should be right... but it fails unit
            // tests. Need to compare to jQuery.
            // $query = new \QueryPath\CSS\DOMTraverser($tmp, TRUE, $m);
            $query = new \QueryPath\CSS\DOMTraverser($tmp);
            $query->find($selector);
            if (count($query->matches())) {
                $found->attach($m);
            }
            $tmp->detach($m);
        }
        return $this->inst($found, null, $this->options);
    }