public function find_problems() {
        global $DB;
        static $answer = null;

        if (is_null($answer)) {
            $categories = $DB->get_records('course_categories', array(), 'id');

            // Look for missing parents.
            $missingparent = tool_health_category_find_missing_parents($categories);

            // Look for loops.
            $loops = tool_health_category_find_loops($categories);

            $answer = array($missingparent, $loops);
        }

        return $answer;
    }
public function find_problems() {
        global $DB;
        static $answer = null;

        if (is_null($answer)) {
            $categories = $DB->get_records('course_categories', array(), 'id');

            // Look for missing parents.
            $missingparent = tool_health_category_find_missing_parents($categories);

            // Look for loops.
            $loops = tool_health_category_find_loops($categories);

            $answer = array($missingparent, $loops);
        }

        return $answer;
    }
public function find_problems ( ) { global $ DB ; static $ answer = null ; if ( is_null ( $ answer ) ) { $ categories = $ DB -> get_records ( 'course_categories' , array ( ) , 'id' ) ; // Look for missing parents. $ missingparent = tool_health_category_find_missing_parents ( $ categories ) ; // Look for loops. $ loops = tool_health_category_find_loops ( $ categories ) ; $ answer = array ( $ missingparent , $ loops ) ; } return $ answer ; }
Search for problems in the course categories.

@uses $DB
@return array List of categories that contain missing parents or loops.
Search for problems in the course categories .