Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 1441
Línea 55... Línea 55...
55
     * @param string $field
55
     * @param string $field
56
     * @param int $columntype
56
     * @param int $columntype
57
     * @return string
57
     * @return string
58
     */
58
     */
59
    public static function get_field_sql(string $field, int $columntype): string {
59
    public static function get_field_sql(string $field, int $columntype): string {
60
        global $DB;
-
 
61
 
-
 
62
        if ($columntype === column::TYPE_LONGTEXT && $DB->get_dbfamily() === 'oracle') {
-
 
63
            $field = $DB->sql_compare_text($field, 255);
-
 
64
        }
-
 
65
 
-
 
66
        return "COUNT({$field})";
60
        return "COUNT({$field})";
67
    }
61
    }
Línea 68... Línea 62...
68
 
62
 
-
 
63
    /**
-
 
64
     * Returns aggregated column type
-
 
65
     *
-
 
66
     * @param int $columntype
-
 
67
     * @return int
-
 
68
     */
-
 
69
    public static function get_column_type(int $columntype): int {
-
 
70
        return column::TYPE_INTEGER;
-
 
71
    }
-
 
72
 
69
    /**
73
    /**
70
     * Return formatted value for column when applying aggregation
74
     * Return formatted value for column when applying aggregation
71
     *
75
     *
72
     * @param mixed $value
76
     * @param mixed $value
73
     * @param array $values
77
     * @param array $values
74
     * @param array $callbacks
78
     * @param array $callbacks
75
     * @param int $columntype
79
     * @param int $columntype
76
     * @return int
80
     * @return int
77
     */
81
     */
78
    public static function format_value($value, array $values, array $callbacks, int $columntype): int {
82
    public function format_value($value, array $values, array $callbacks, int $columntype): int {
79
        return (int) reset($values);
83
        return (int) reset($values);
80
    }
84
    }