protected static function approved_contextlist_contains_my_context(approved_contextlist $contextlist) {
        $userid = $contextlist->get_user()->id;
        foreach ($contextlist->get_contexts() as $context) {
            if ($context->contextlevel == CONTEXT_USER && $context->instanceid == $userid) {
                return true;
            }
        }
        return false;
    }
protected static function approved_contextlist_contains_my_context(approved_contextlist $contextlist) {
        $userid = $contextlist->get_user()->id;
        foreach ($contextlist->get_contexts() as $context) {
            if ($context->contextlevel == CONTEXT_USER && $context->instanceid == $userid) {
                return true;
            }
        }
        return false;
    }
protected static function approved_contextlist_contains_my_context ( approved_contextlist $ contextlist ) { $ userid = $ contextlist -> get_user ( ) -> id ; foreach ( $ contextlist -> get_contexts ( ) as $ context ) { if ( $ context -> contextlevel == CONTEXT_USER && $ context -> instanceid == $ userid ) { return true ; } } return false ; }
Return whether the contextlist contains our own context.

@param approved_contextlist $contextlist The contextlist
@return bool
Return whether the contextlist contains our own context .