src/Zicht/Bundle/MenuBundle/Menu/Builder.php
public function addMenuItemHierarchy($request, $children, $parent)
    {
        $ret = 0;
        foreach ($children as $child) {
            $ret++;
            $item = $this->addMenuItem($request, $child, $parent);
            if (!empty($child['__children'])) {
                $ret += $this->addMenuItemHierarchy($request, $child['__children'], $item);
            }
        }
        return $ret;
    }
public function addMenuItemHierarchy($request, $children, $parent)
    {
        $ret = 0;
        foreach ($children as $child) {
            $ret++;
            $item = $this->addMenuItem($request, $child, $parent);
            if (!empty($child['__children'])) {
                $ret += $this->addMenuItemHierarchy($request, $child['__children'], $item);
            }
        }
        return $ret;
    }
public function addMenuItemHierarchy ( $ request , $ children , $ parent ) { $ ret = 0 ; foreach ( $ children as $ child ) { $ ret ++ ; $ item = $ this -> addMenuItem ( $ request , $ child , $ parent ) ; if ( ! empty ( $ child [ '__children' ] ) ) { $ ret += $ this -> addMenuItemHierarchy ( $ request , $ child [ '__children' ] , $ item ) ; } } return $ ret ; }
Add menu item hierarchy

@param Request $request
@param mixed $children
@param ItemInterface $parent
@return int
Add menu item hierarchy