public static function list_courses_min($competencyid) {
        global $DB;

        $results = $DB->get_records_sql('SELECT course.id as id, course.visible as visible
                                           FROM {' . self::TABLE . '} coursecomp
                                           JOIN {course} course
                                             ON coursecomp.courseid = course.id
                                          WHERE coursecomp.competencyid = ? ', array($competencyid));

        return $results;
    }
public static function list_courses_min($competencyid) {
        global $DB;

        $results = $DB->get_records_sql('SELECT course.id as id, course.visible as visible
                                           FROM {' . self::TABLE . '} coursecomp
                                           JOIN {course} course
                                             ON coursecomp.courseid = course.id
                                          WHERE coursecomp.competencyid = ? ', array($competencyid));

        return $results;
    }
public static function list_courses_min ( $ competencyid ) { global $ DB ; $ results = $ DB -> get_records_sql ( 'SELECT course.id as id, course.visible as visible
                                           FROM {' . self :: TABLE . '} coursecomp
                                           JOIN {course} course
                                             ON coursecomp.courseid = course.id
                                          WHERE coursecomp.competencyid = ? ' , array ( $ competencyid ) ) ; return $ results ; }
Return the course IDs and visible flags that include this competency.

Only the ids and visible flag are returned, for the full records use list_courses.

@param int $competencyid The competency id
@return array containing courseid and visible.
Return the course IDs and visible flags that include this competency .