mirror of
https://github.com/moodle/moodle.git
synced 2025-04-13 04:22:07 +02:00
MDL-74175 cohort: correct type/callback of entity category column.
This commit is contained in:
parent
967d9b2546
commit
b73a69b920
@ -94,11 +94,11 @@ class cohort extends base {
|
||||
$this->get_entity_name()
|
||||
))
|
||||
->add_joins($this->get_joins())
|
||||
->set_type(column::TYPE_INTEGER)
|
||||
->set_type(column::TYPE_TEXT)
|
||||
->add_fields("{$tablealias}.contextid")
|
||||
->set_is_sortable(true)
|
||||
->add_callback(static function(int $contextid): string {
|
||||
return context::instance_by_id($contextid)->get_context_name(false);
|
||||
->add_callback(static function($contextid): string {
|
||||
return context::instance_by_id((int) $contextid)->get_context_name(false);
|
||||
});
|
||||
|
||||
// Name column.
|
||||
|
@ -478,7 +478,9 @@ final class column {
|
||||
* The callback should implement the following signature (where $value is the first column field, $row is all column
|
||||
* fields, and $additionalarguments are those passed on from this method):
|
||||
*
|
||||
* The type of the $value parameter passed to the callback is determined by calling {@see set_type}
|
||||
* The type of the $value parameter passed to the callback is determined by calling {@see set_type}, however note that
|
||||
* if the column is part of a report source and can be aggregated using one of the "Group concatenation" methods then the
|
||||
* type should be omitted if it's not string
|
||||
*
|
||||
* function($value, stdClass $row[, $additionalarguments]): string
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user