MDL-81065 core_filters: New WS core_filters_get_all_states

This commit is contained in:
Juan Leyva
2024-03-07 15:52:07 +01:00
parent b2fa19f45d
commit f693e84ff5
4 changed files with 178 additions and 0 deletions
+10
View File
@@ -1316,6 +1316,16 @@ function filter_get_global_states() {
return $DB->get_records('filter_active', array('contextid' => $context->id), 'sortorder', 'filter,active,sortorder');
}
/**
* Retrieve all the filters and their states (including overridden ones in any context).
*
* @return array filters objects containing filter name, context, active state and sort order.
*/
function filter_get_all_states(): array {
global $DB;
return $DB->get_records('filter_active');
}
/**
* Delete all the data in the database relating to a filter, prior to deleting it.
*