MDL-40404 Libraries: Deprecated get_parent_contextid()

This commit is contained in:
Rajesh Taneja
2013-07-04 12:59:06 +08:00
parent 766fd0d92f
commit 7f5b51c4e6
12 changed files with 35 additions and 37 deletions

View File

@@ -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;
}
}