MDL-40462 libraries: deprecated get_course_context()

This commit is contained in:
Mark Nelson
2013-07-11 13:28:45 +08:00
parent 9c03dff2c9
commit dd33f4af0a
7 changed files with 20 additions and 16 deletions
+13
View File
@@ -4153,3 +4153,16 @@ function get_context_url(context $context) {
return $context->get_url();
}
/**
* Is this context part of any course? if yes return course context,
* if not return null or throw exception.
*
* @deprecated since 2.2
* @see context::get_course_context()
* @param context $context
* @return course_context context of the enclosing course, null if not found or exception
*/
function get_course_context(context $context) {
debugging('get_course_context() is deprecated, please use $context->get_course_context(true) instead.', DEBUG_DEVELOPER);
return $context->get_course_context(true);
}