protected function get_parent_context() : \context {
        global $PAGE;
        if ($this->parentcontext) {
            return $this->parentcontext;
        } else if ($PAGE->context && $PAGE->context instanceof \context_coursecat) {
            return $PAGE->context;
        }
        return \context_system::instance();
    }
protected function get_parent_context() : \context {
        global $PAGE;
        if ($this->parentcontext) {
            return $this->parentcontext;
        } else if ($PAGE->context && $PAGE->context instanceof \context_coursecat) {
            return $PAGE->context;
        }
        return \context_system::instance();
    }
protected function get_parent_context ( ) : \ context { global $ PAGE ; if ( $ this -> parentcontext ) { return $ this -> parentcontext ; } else if ( $ PAGE -> context && $ PAGE -> context instanceof \ context_coursecat ) { return $ PAGE -> context ; } return \ context_system :: instance ( ) ; }
Returns the parent context for the course

@return \context
Returns the parent context for the course