original_string: public static function move_context($component, $itemtype, $oldcontext, $newcontext) {
          global $DB;
          if ($oldcontext instanceof context) {
              $oldcontext = $oldcontext->id;
          }
          if ($newcontext instanceof context) {
              $newcontext = $newcontext->id;
          }
          $DB->set_field('tag_instance', 'contextid', $newcontext,
                  array('component' => $component, 'itemtype' => $itemtype, 'contextid' => $oldcontext));
      }
code: public static function move_context($component, $itemtype, $oldcontext, $newcontext) {
          global $DB;
          if ($oldcontext instanceof context) {
              $oldcontext = $oldcontext->id;
          }
          if ($newcontext instanceof context) {
              $newcontext = $newcontext->id;
          }
          $DB->set_field('tag_instance', 'contextid', $newcontext,
                  array('component' => $component, 'itemtype' => $itemtype, 'contextid' => $oldcontext));
      }
code_tokens: public static function move_context ( $ component , $ itemtype , $ oldcontext , $ newcontext ) { global $ DB ; if ( $ oldcontext instanceof context ) { $ oldcontext = $ oldcontext -> id ; } if ( $ newcontext instanceof context ) { $ newcontext = $ newcontext -> id ; } $ DB -> set_field ( 'tag_instance' , 'contextid' , $ newcontext , array ( 'component' => $ component , 'itemtype' => $ itemtype , 'contextid' => $ oldcontext ) ) ; }
docstring: Allows to move all tag instances from one context to another
  
  @param string $component the component that was tagged
  @param string $itemtype the type of record to tag ('post' for blogs, 'user' for users, etc.)
  @param context $oldcontext
  @param context $newcontext
docstring_tokens: Allows to move all tag instances from one context to another