public function has($selector)
    {
        $result = $this->createChildInstance();

        if ($this->length > 0) {
            foreach ($this as $node) {
                if ($node->find($selector)->length > 0) {
                    $result->addDomNode($node->get(0));
                }
            }
        }

        return $result;
    }
public function has($selector)
    {
        $result = $this->createChildInstance();

        if ($this->length > 0) {
            foreach ($this as $node) {
                if ($node->find($selector)->length > 0) {
                    $result->addDomNode($node->get(0));
                }
            }
        }

        return $result;
    }
public function has ( $ selector ) { $ result = $ this -> createChildInstance ( ) ; if ( $ this -> length > 0 ) { foreach ( $ this as $ node ) { if ( $ node -> find ( $ selector ) -> length > 0 ) { $ result -> addDomNode ( $ node -> get ( 0 ) ) ; } } } return $ result ; }
Reduce the set of matched elements to those that have a descendant that matches the selector

@param string|self|callable|\DOMNodeList|\DOMNode $selector

@return self
Reduce the set of matched elements to those that have a descendant that matches the selector