public function get_instance_context(int $instanceid = 0) : \context {
        if ($instanceid > 0) {
            return \context_course::instance($instanceid);
        } else {
            return \context_system::instance();
        }
    }
public function get_instance_context(int $instanceid = 0) : \context {
        if ($instanceid > 0) {
            return \context_course::instance($instanceid);
        } else {
            return \context_system::instance();
        }
    }
public function get_instance_context ( int $ instanceid = 0 ) : \ context { if ( $ instanceid > 0 ) { return \ context_course :: instance ( $ instanceid ) ; } else { return \ context_system :: instance ( ) ; } }
Returns the context for the data associated with the given instanceid.

@param int $instanceid id of the record to get the context for
@return \context the context for the given record
Returns the context for the data associated with the given instanceid .