protected function get_all_groups($courseid) {
        global $CFG;
        require_once($CFG->libdir . '/grouplib.php');

        if ($courseid != $this->allgroupscourseid) {
            $this->allgroups = groups_get_all_groups($courseid, 0, 0, 'g.id, g.name');
            $this->allgroupscourseid = $courseid;
        }
        return $this->allgroups;
    }
protected function get_all_groups($courseid) {
        global $CFG;
        require_once($CFG->libdir . '/grouplib.php');

        if ($courseid != $this->allgroupscourseid) {
            $this->allgroups = groups_get_all_groups($courseid, 0, 0, 'g.id, g.name');
            $this->allgroupscourseid = $courseid;
        }
        return $this->allgroups;
    }
protected function get_all_groups ( $ courseid ) { global $ CFG ; require_once ( $ CFG -> libdir . '/grouplib.php' ) ; if ( $ courseid != $ this -> allgroupscourseid ) { $ this -> allgroups = groups_get_all_groups ( $ courseid , 0 , 0 , 'g.id, g.name' ) ; $ this -> allgroupscourseid = $ courseid ; } return $ this -> allgroups ; }
Gets all groups for the given course.

@param int $courseid Course id
@return array Array of all the group objects
Gets all groups for the given course .