original_string: protected function process_assign_userflag($data) {
          global $DB;
  
          $data = (object)$data;
          $oldid = $data->id;
  
          $data->assignment = $this->get_new_parentid('assign');
  
          $data->userid = $this->get_mappingid('user', $data->userid);
          if (!empty($data->allocatedmarker)) {
              $data->allocatedmarker = $this->get_mappingid('user', $data->allocatedmarker);
          }
          if (!empty($data->extensionduedate)) {
              $data->extensionduedate = $this->apply_date_offset($data->extensionduedate);
          } else {
              $data->extensionduedate = 0;
          }
          // Flags mailed and locked need no translation on restore.
  
          $newitemid = $DB->insert_record('assign_user_flags', $data);
      }
code: protected function process_assign_userflag($data) {
          global $DB;
  
          $data = (object)$data;
          $oldid = $data->id;
  
          $data->assignment = $this->get_new_parentid('assign');
  
          $data->userid = $this->get_mappingid('user', $data->userid);
          if (!empty($data->allocatedmarker)) {
              $data->allocatedmarker = $this->get_mappingid('user', $data->allocatedmarker);
          }
          if (!empty($data->extensionduedate)) {
              $data->extensionduedate = $this->apply_date_offset($data->extensionduedate);
          } else {
              $data->extensionduedate = 0;
          }
          // Flags mailed and locked need no translation on restore.
  
          $newitemid = $DB->insert_record('assign_user_flags', $data);
      }
code_tokens: protected function process_assign_userflag ( $ data ) { global $ DB ; $ data = ( object ) $ data ; $ oldid = $ data -> id ; $ data -> assignment = $ this -> get_new_parentid ( 'assign' ) ; $ data -> userid = $ this -> get_mappingid ( 'user' , $ data -> userid ) ; if ( ! empty ( $ data -> allocatedmarker ) ) { $ data -> allocatedmarker = $ this -> get_mappingid ( 'user' , $ data -> allocatedmarker ) ; } if ( ! empty ( $ data -> extensionduedate ) ) { $ data -> extensionduedate = $ this -> apply_date_offset ( $ data -> extensionduedate ) ; } else { $ data -> extensionduedate = 0 ; } // Flags mailed and locked need no translation on restore. $ newitemid = $ DB -> insert_record ( 'assign_user_flags' , $ data ) ; }
docstring: Process a user_flags restore
  @param object $data The data in object form
  @return void
docstring_tokens: Process a user_flags restore