diff --git a/.upgradenotes/MDL-80430-2024083015011365.yml b/.upgradenotes/MDL-80430-2024083015011365.yml new file mode 100644 index 00000000000..e143383bb57 --- /dev/null +++ b/.upgradenotes/MDL-80430-2024083015011365.yml @@ -0,0 +1,8 @@ +issueNumber: MDL-80430 +notes: + core_reportbuilder: + - message: >- + Final removal of support for `get_default_table_aliases` method. + Entities must now implement `get_default_tables`, which is now abstract, + to define the tables they use + type: removed diff --git a/reportbuilder/classes/local/entities/base.php b/reportbuilder/classes/local/entities/base.php index d396e4464b3..5f721b70980 100644 --- a/reportbuilder/classes/local/entities/base.php +++ b/reportbuilder/classes/local/entities/base.php @@ -57,40 +57,18 @@ abstract class base { private $conditions = []; /** - * Database tables that this entity uses - * - * Must be overridden by the entity to list all database tables that it expects to be present in the main - * SQL or in JOINs added to this entity - * - * @todo in Moodle 4.8 - make abstract when support for {@see get_default_table_aliases} is finally removed + * Database tables that the entity expects to be present in the main SQL or in JOINs added to it * * @return string[] */ - protected function get_default_tables(): array { - static $debuggingshown; - - // The default implementation falls back to retrieving deprecated table aliases to determine our table names. - $tablenamealiases = $this->get_default_table_aliases(); - if (!empty($tablenamealiases) && !$debuggingshown) { - debugging('The function get_default_table_aliases() is deprecated, please define the entity' . - ' tables with get_default_tables() in ' . static::class, DEBUG_DEVELOPER); - - // Don't be too spammy with the debugging, this method is called multiple times per entity load. - $debuggingshown = true; - } - - return array_keys($tablenamealiases); - } + abstract protected function get_default_tables(): array; /** - * Database tables that this entity uses and their default aliases (note that these aliases are now ignored) - * - * @return string[] Array of $tablename => $alias - * * @deprecated since Moodle 4.4 - aliases are now autogenerated, please implement {@see get_default_tables} instead */ - protected function get_default_table_aliases(): array { - return []; + #[\core\attribute\deprecated('::get_default_tables', since: '4.4', mdl: 'MDL-79397', final: true)] + protected function get_default_table_aliases(): void { + \core\deprecation::emit_deprecation_if_present([self::class, __FUNCTION__]); } /**