protected function get_grouping_id(\core_availability\info $info) {
        if ($this->activitygrouping) {
            $groupingid = $info->get_course_module()->groupingid;
            if (!$groupingid) {
                throw new \coding_exception(
                        'Not supposed to be able to turn on activitygrouping when no grouping');
            }
            return $groupingid;
        } else {
            return $this->groupingid;
        }
    }
protected function get_grouping_id(\core_availability\info $info) {
        if ($this->activitygrouping) {
            $groupingid = $info->get_course_module()->groupingid;
            if (!$groupingid) {
                throw new \coding_exception(
                        'Not supposed to be able to turn on activitygrouping when no grouping');
            }
            return $groupingid;
        } else {
            return $this->groupingid;
        }
    }
protected function get_grouping_id ( \ core_availability \ info $ info ) { if ( $ this -> activitygrouping ) { $ groupingid = $ info -> get_course_module ( ) -> groupingid ; if ( ! $ groupingid ) { throw new \ coding_exception ( 'Not supposed to be able to turn on activitygrouping when no grouping' ) ; } return $ groupingid ; } else { return $ this -> groupingid ; } }
Gets the actual grouping id for the condition. This is either a specified
id, or a special flag indicating that we use the one for the current cm.

@param \core_availability\info $info Info about context cm
@return int Grouping id
@throws \coding_exception If it's set to use a cm but there isn't grouping
Gets the actual grouping id for the condition . This is either a specified id or a special flag indicating that we use the one for the current cm .