public static function change_instances_context(array $taginstanceids, context $newcontext) {
        global $DB;

        if (empty($taginstanceids)) {
            return;
        }

        list($sql, $params) = $DB->get_in_or_equal($taginstanceids);
        $DB->set_field_select('tag_instance', 'contextid', $newcontext->id, "id {$sql}", $params);
    }
public static function change_instances_context(array $taginstanceids, context $newcontext) {
        global $DB;

        if (empty($taginstanceids)) {
            return;
        }

        list($sql, $params) = $DB->get_in_or_equal($taginstanceids);
        $DB->set_field_select('tag_instance', 'contextid', $newcontext->id, "id {$sql}", $params);
    }
public static function change_instances_context ( array $ taginstanceids , context $ newcontext ) { global $ DB ; if ( empty ( $ taginstanceids ) ) { return ; } list ( $ sql , $ params ) = $ DB -> get_in_or_equal ( $ taginstanceids ) ; $ DB -> set_field_select ( 'tag_instance' , 'contextid' , $ newcontext -> id , "id {$sql}" , $ params ) ; }
Moves all of the specified tag instances into a new context.

@param array $taginstanceids The list of tag instance ids that should be moved
@param context $newcontext The context to move the tag instances into
Moves all of the specified tag instances into a new context .