Merge branch 'w16_MDL-45100_m25_coursecontext' of https://github.com/skodak/moodle into MOODLE_25_STABLE
This commit is contained in:
+5
-5
@@ -5494,7 +5494,7 @@ abstract class context extends stdClass implements IteratorAggregate {
|
||||
* Is this context part of any course? If yes return course context.
|
||||
*
|
||||
* @param bool $strict true means throw exception if not found, false means return false if not found
|
||||
* @return course_context context of the enclosing course, null if not found or exception
|
||||
* @return context_course context of the enclosing course, null if not found or exception
|
||||
*/
|
||||
public function get_course_context($strict = true) {
|
||||
if ($strict) {
|
||||
@@ -6589,7 +6589,7 @@ class context_course extends context {
|
||||
* Is this context part of any course? If yes return course context.
|
||||
*
|
||||
* @param bool $strict true means throw exception if not found, false means return false if not found
|
||||
* @return course_context context of the enclosing course, null if not found or exception
|
||||
* @return context_course context of the enclosing course, null if not found or exception
|
||||
*/
|
||||
public function get_course_context($strict = true) {
|
||||
return $this;
|
||||
@@ -6847,7 +6847,7 @@ class context_module extends context {
|
||||
* Is this context part of any course? If yes return course context.
|
||||
*
|
||||
* @param bool $strict true means throw exception if not found, false means return false if not found
|
||||
* @return course_context context of the enclosing course, null if not found or exception
|
||||
* @return context_course context of the enclosing course, null if not found or exception
|
||||
*/
|
||||
public function get_course_context($strict = true) {
|
||||
return $this->get_parent_context();
|
||||
@@ -7055,7 +7055,7 @@ class context_block extends context {
|
||||
* Is this context part of any course? If yes return course context.
|
||||
*
|
||||
* @param bool $strict true means throw exception if not found, false means return false if not found
|
||||
* @return course_context context of the enclosing course, null if not found or exception
|
||||
* @return context_course context of the enclosing course, null if not found or exception
|
||||
*/
|
||||
public function get_course_context($strict = true) {
|
||||
$parentcontext = $this->get_parent_context();
|
||||
@@ -7521,7 +7521,7 @@ function get_context_url(context $context) {
|
||||
*
|
||||
* @deprecated since 2.2, use $context->get_course_context() instead
|
||||
* @param context $context
|
||||
* @return course_context context of the enclosing course, null if not found or exception
|
||||
* @return context_course context of the enclosing course, null if not found or exception
|
||||
*/
|
||||
function get_course_context(context $context) {
|
||||
return $context->get_course_context(true);
|
||||
|
||||
Reference in New Issue
Block a user