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

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

Get the first child of the matching element.
См. также: next()
См. также: prev()
С версии: 2.1
Автор: eabrand
public firstChild ( )
    public function firstChild()
    {
        // Could possibly use $m->firstChild http://theserverpages.com/php/manual/en/ref.dom.php
        $found = new \SplObjectStorage();
        $flag = false;
        foreach ($this->matches as $m) {
            foreach ($m->childNodes as $c) {
                if ($c->nodeType == XML_ELEMENT_NODE) {
                    $found->attach($c);
                    $flag = true;
                    break;
                }
            }
            if ($flag) {
                break;
            }
        }
        return $this->inst($found, null, $this->options);
    }