mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 05:58:34 +01:00
MDL-78117 comment: use new context entity in system report.
This commit is contained in:
parent
d8df4ad675
commit
ca6731dff7
@ -23,6 +23,7 @@ use lang_string;
|
||||
use moodle_url;
|
||||
use pix_icon;
|
||||
use stdClass;
|
||||
use core\reportbuilder\local\entities\context;
|
||||
use core_reportbuilder\system_report;
|
||||
use core_reportbuilder\local\entities\user;
|
||||
use core_reportbuilder\local\report\action;
|
||||
@ -53,6 +54,13 @@ class comments extends system_report {
|
||||
return [$row->id, get_string('select')];
|
||||
});
|
||||
|
||||
// Join the context entity.
|
||||
$contextentity = (new context())
|
||||
->set_table_alias('context', $commententity->get_table_alias('context'));
|
||||
$this->add_entity($contextentity
|
||||
->add_join($commententity->get_context_join())
|
||||
);
|
||||
|
||||
// Join the user entity to the comment userid (author).
|
||||
$userentity = new user();
|
||||
$useralias = $userentity->get_table_alias('user');
|
||||
@ -82,7 +90,7 @@ class comments extends system_report {
|
||||
$this->add_columns_from_entities([
|
||||
'user:fullnamewithlink',
|
||||
'comment:content',
|
||||
'comment:contexturl',
|
||||
'context:link',
|
||||
'comment:timecreated',
|
||||
]);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user