From 685fe0800316b97b1de1fbedc4dadcc8bb0a05ee Mon Sep 17 00:00:00 2001 From: Andrew Nicols Date: Thu, 23 Apr 2020 09:59:54 +0800 Subject: [PATCH] MDL-68454 table: Improve documentation for dynamic table --- lib/table/classes/dynamic.php | 14 ++++++++++---- lib/upgrade.txt | 2 ++ 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/lib/table/classes/dynamic.php b/lib/table/classes/dynamic.php index 38895294af8..4288756b822 100644 --- a/lib/table/classes/dynamic.php +++ b/lib/table/classes/dynamic.php @@ -19,7 +19,6 @@ * * @package core_table * @copyright 2020 Simey Lameze - * * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -27,12 +26,19 @@ declare(strict_types=1); namespace core_table; -defined('MOODLE_INTERNAL') || die(); - /** - * Interface dynamic. + * Interface to identify this table as a table which can be dynamically updated via webservice calls. + * + * For a table to be defined as dynamic it must meet the following requirements: + * + * # it must be located with a namespaced class of \[component]\table\[tablename] + * # it must define a \core_table\local\filter\filterset implementation in \[component]\table\[tablename]_filterset + * # it must override the {{guess_base_url}} function and specify a base URL to be used when constructing URLs + * # it must override the {{get_context}} function to specify the correct context * * @package core_table + * @copyright 2020 Simey Lameze + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ interface dynamic { } diff --git a/lib/upgrade.txt b/lib/upgrade.txt index eb04ddcbad5..04d9108bae6 100644 --- a/lib/upgrade.txt +++ b/lib/upgrade.txt @@ -47,6 +47,8 @@ information provided here is intended especially for developers. db/services.php. Note - this also requires $CFG->enable_read_only_sessions to be set to true. * database_manager::check_database_schema() now checks for missing and extra indexes. * Implement a more direct xsendfile_file() method for an alternative_file_system_class +* A new `dynamic` table interface has been defined, which allows any `flexible_table` to be converted into a table which + is updatable via ajax calls. See MDL-68495 and `\core_table\dynamic` for further information. === 3.8 === * Add CLI option to notify all cron tasks to stop: admin/cli/cron.php --stop -- 2.43.0