public function get_aggregation_method($aggregate) {
        $aggregatestr = null;
        switch($aggregate){
            case RATING_AGGREGATE_AVERAGE:
                $aggregatestr = 'AVG';
                break;
            case RATING_AGGREGATE_COUNT:
                $aggregatestr = 'COUNT';
                break;
            case RATING_AGGREGATE_MAXIMUM:
                $aggregatestr = 'MAX';
                break;
            case RATING_AGGREGATE_MINIMUM:
                $aggregatestr = 'MIN';
                break;
            case RATING_AGGREGATE_SUM:
                $aggregatestr = 'SUM';
                break;
            default:
                $aggregatestr = 'AVG'; // Default to this to avoid real breakage - MDL-22270.
                debugging('Incorrect call to get_aggregation_method(), incorrect aggregate method ' . $aggregate, DEBUG_DEVELOPER);
        }
        return $aggregatestr;
    }
public function get_aggregation_method($aggregate) {
        $aggregatestr = null;
        switch($aggregate){
            case RATING_AGGREGATE_AVERAGE:
                $aggregatestr = 'AVG';
                break;
            case RATING_AGGREGATE_COUNT:
                $aggregatestr = 'COUNT';
                break;
            case RATING_AGGREGATE_MAXIMUM:
                $aggregatestr = 'MAX';
                break;
            case RATING_AGGREGATE_MINIMUM:
                $aggregatestr = 'MIN';
                break;
            case RATING_AGGREGATE_SUM:
                $aggregatestr = 'SUM';
                break;
            default:
                $aggregatestr = 'AVG'; // Default to this to avoid real breakage - MDL-22270.
                debugging('Incorrect call to get_aggregation_method(), incorrect aggregate method ' . $aggregate, DEBUG_DEVELOPER);
        }
        return $aggregatestr;
    }
public function get_aggregation_method ( $ aggregate ) { $ aggregatestr = null ; switch ( $ aggregate ) { case RATING_AGGREGATE_AVERAGE : $ aggregatestr = 'AVG' ; break ; case RATING_AGGREGATE_COUNT : $ aggregatestr = 'COUNT' ; break ; case RATING_AGGREGATE_MAXIMUM : $ aggregatestr = 'MAX' ; break ; case RATING_AGGREGATE_MINIMUM : $ aggregatestr = 'MIN' ; break ; case RATING_AGGREGATE_SUM : $ aggregatestr = 'SUM' ; break ; default : $ aggregatestr = 'AVG' ; // Default to this to avoid real breakage - MDL-22270. debugging ( 'Incorrect call to get_aggregation_method(), incorrect aggregate method ' . $ aggregate , DEBUG_DEVELOPER ) ; } return $ aggregatestr ; }
Converts an aggregation method constant into something that can be included in SQL

@param int $aggregate An aggregation constant. For example, RATING_AGGREGATE_AVERAGE.
@return string an SQL aggregation method
Converts an aggregation method constant into something that can be included in SQL