public function getFirstChild()
    {
        if($this->isLeaf())
        {
            return null;
        }

        if($this->children !== null)
        {
            $ary = array_slice($this->children, 0, 1);
            return $ary[0];
        }

        $qb = $this->getManager()->getConfiguration()->getBaseQueryBuilder();
        $alias = $this->getManager()->getConfiguration()->getQueryBuilderAlias();

        $qb->andWhere("$alias.".$this->getLeftFieldName()." = :lft1")
            ->setParameter('lft1', $this->getLeftValue() + 1);
        if($this->hasManyRoots())
        {
            $qb->andWhere("$alias.".$this->getRootFieldName()." = :root")
                ->setParameter('root', $this->getRootValue());
        }

        $q = $qb->getQuery();
		if ($this->getManager()->getConfiguration()->isQueryHintSet()){
			$q = $this->getManager()->addHintToQuery($q);
		}
		$results = $q->getResult();

        return $this->getManager()->wrapNode($results[0]);
    }
public function getFirstChild()
    {
        if($this->isLeaf())
        {
            return null;
        }

        if($this->children !== null)
        {
            $ary = array_slice($this->children, 0, 1);
            return $ary[0];
        }

        $qb = $this->getManager()->getConfiguration()->getBaseQueryBuilder();
        $alias = $this->getManager()->getConfiguration()->getQueryBuilderAlias();

        $qb->andWhere("$alias.".$this->getLeftFieldName()." = :lft1")
            ->setParameter('lft1', $this->getLeftValue() + 1);
        if($this->hasManyRoots())
        {
            $qb->andWhere("$alias.".$this->getRootFieldName()." = :root")
                ->setParameter('root', $this->getRootValue());
        }

        $q = $qb->getQuery();
		if ($this->getManager()->getConfiguration()->isQueryHintSet()){
			$q = $this->getManager()->addHintToQuery($q);
		}
		$results = $q->getResult();

        return $this->getManager()->wrapNode($results[0]);
    }
public function getFirstChild ( ) { if ( $ this -> isLeaf ( ) ) { return null ; } if ( $ this -> children !== null ) { $ ary = array_slice ( $ this -> children , 0 , 1 ) ; return $ ary [ 0 ] ; } $ qb = $ this -> getManager ( ) -> getConfiguration ( ) -> getBaseQueryBuilder ( ) ; $ alias = $ this -> getManager ( ) -> getConfiguration ( ) -> getQueryBuilderAlias ( ) ; $ qb -> andWhere ( "$alias." . $ this -> getLeftFieldName ( ) . " = :lft1" ) -> setParameter ( 'lft1' , $ this -> getLeftValue ( ) + 1 ) ; if ( $ this -> hasManyRoots ( ) ) { $ qb -> andWhere ( "$alias." . $ this -> getRootFieldName ( ) . " = :root" ) -> setParameter ( 'root' , $ this -> getRootValue ( ) ) ; } $ q = $ qb -> getQuery ( ) ; if ( $ this -> getManager ( ) -> getConfiguration ( ) -> isQueryHintSet ( ) ) { $ q = $ this -> getManager ( ) -> addHintToQuery ( $ q ) ; } $ results = $ q -> getResult ( ) ; return $ this -> getManager ( ) -> wrapNode ( $ results [ 0 ] ) ; }
gets first child or null

@return NodeWrapper
gets first child or null