mirror of
https://github.com/moodle/moodle.git
synced 2025-07-25 16:21:47 +02:00
MDL-40404 Libraries: Deprecated get_parent_contextid()
This commit is contained in:
@@ -4946,9 +4946,20 @@ function get_parent_contexts(context $context, $includeself = false) {
|
||||
}
|
||||
|
||||
/**
|
||||
* This function has been deprecated please use {@link message_get_providers_for_user()} instead.
|
||||
* @deprecated since 2.1
|
||||
* Return the id of the parent of this context, or false if there is no parent (only happens if this
|
||||
* is the site context.)
|
||||
*
|
||||
* @deprecated since Moodle 2.2
|
||||
* @see context::get_parent_context()
|
||||
* @param context $context
|
||||
* @return integer the id of the parent context.
|
||||
*/
|
||||
function message_get_my_providers() {
|
||||
throw new coding_exception('message_get_my_providers() is deprecated please use message_get_providers_for_user()');
|
||||
function get_parent_contextid(context $context) {
|
||||
debugging('get_parent_contextid() is deprecated, please use $context->get_parent_context() instead.', DEBUG_DEVELOPER);
|
||||
|
||||
if ($parent = $context->get_parent_context()) {
|
||||
return $parent->id;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user