protected function find_categories_after($category) {
        $return = array();
        $categoryarray = $this->categories;
        foreach ($categoryarray as $categoryelement) {
            if ($categoryelement->after == $category->name) {
                // Find all categories that comes after this category as well.
                $categoryelement->sort_nodes();
                $return = array_merge($return, array($categoryelement->name => $categoryelement),
                        $this->find_categories_after($categoryelement));
            }
        }
        return $return;
    }
protected function find_categories_after($category) {
        $return = array();
        $categoryarray = $this->categories;
        foreach ($categoryarray as $categoryelement) {
            if ($categoryelement->after == $category->name) {
                // Find all categories that comes after this category as well.
                $categoryelement->sort_nodes();
                $return = array_merge($return, array($categoryelement->name => $categoryelement),
                        $this->find_categories_after($categoryelement));
            }
        }
        return $return;
    }
protected function find_categories_after ( $ category ) { $ return = array ( ) ; $ categoryarray = $ this -> categories ; foreach ( $ categoryarray as $ categoryelement ) { if ( $ categoryelement -> after == $ category -> name ) { // Find all categories that comes after this category as well. $ categoryelement -> sort_nodes ( ) ; $ return = array_merge ( $ return , array ( $ categoryelement -> name => $ categoryelement ) , $ this -> find_categories_after ( $ categoryelement ) ) ; } } return $ return ; }
Find all category nodes that should be displayed after a given a category node.

@param category $category category object

@return category[] array of category objects
@throws \coding_exception
Find all category nodes that should be displayed after a given a category node .