mirror of
https://github.com/moodle/moodle.git
synced 2025-08-08 02:16:41 +02:00
MDL-79397 reportbuilder: update reports to use auto-generated aliases.
We no longer need to be concerned about the manual setting of entity table aliases (e.g. to avoid duplication between entities, or for using a single entity multiple times), as it's handled transparently for us.
This commit is contained in:
parent
7143cf4cbc
commit
3dec3fb8ce
3 changed files with 17 additions and 22 deletions
|
@ -60,13 +60,13 @@ class categories extends datasource {
|
|||
$this->add_entity($courseentity
|
||||
->add_join("LEFT JOIN {course} {$coursealias} ON {$coursealias}.category = {$categoryalias}.id"));
|
||||
|
||||
// Join cohort entity (amend alias to avoid clash with course entity, indicate context table join alias).
|
||||
// Join cohort entity (indicate context table join alias).
|
||||
$cohortentity = (new cohort())
|
||||
->set_table_alias('cohort', 'ch')
|
||||
->set_table_join_alias('context', $contextalias);
|
||||
$cohort = $cohortentity->get_table_alias('cohort');
|
||||
$this->add_entity($cohortentity
|
||||
->add_join($categoryentity->get_context_join())
|
||||
->add_join("LEFT JOIN {cohort} ch ON ch.contextid = {$contextalias}.id"));
|
||||
->add_join("LEFT JOIN {cohort} {$cohort} ON {$cohort}.contextid = {$contextalias}.id"));
|
||||
|
||||
// Join role entity.
|
||||
$roleentity = (new role())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue