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

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

Filter a list to contain only items that do NOT match.
См. также: find()
public not ( string $selector )
$selector string A selector to use as a negation filter. If the filter is matched, the element will be removed from the list.
    public function not($selector)
    {
        $found = new \SplObjectStorage();
        if ($selector instanceof \DOMElement) {
            foreach ($this->matches as $m) {
                if ($m !== $selector) {
                    $found->attach($m);
                }
            }
        } elseif (is_array($selector)) {
            foreach ($this->matches as $m) {
                if (!in_array($m, $selector, true)) {
                    $found->attach($m);
                }
            }
        } elseif ($selector instanceof \SplObjectStorage) {
            foreach ($this->matches as $m) {
                if ($selector->contains($m)) {
                    $found->attach($m);
                }
            }
        } else {
            foreach ($this->matches as $m) {
                if (!QueryPath::with($m, null, $this->options)->is($selector)) {
                    $found->attach($m);
                }
            }
        }
        return $this->inst($found, null, $this->options);
    }