original_string: public static function get_unused_idnumber($idnumber) {
          global $DB;
  
          $currentidnumber = $idnumber;
          $counter = 0;
          // Iteratere while the idnumber exists.
          while ($DB->record_exists_select(static::TABLE, 'idnumber = ?', array($currentidnumber))) {
              $suffixidnumber = '_' . ++$counter;
              $currentidnumber = substr($idnumber, 0, 100 - strlen($suffixidnumber)).$suffixidnumber;
          }
  
          // Return the uniq idnumber.
          return $currentidnumber;
      }
code: public static function get_unused_idnumber($idnumber) {
          global $DB;
  
          $currentidnumber = $idnumber;
          $counter = 0;
          // Iteratere while the idnumber exists.
          while ($DB->record_exists_select(static::TABLE, 'idnumber = ?', array($currentidnumber))) {
              $suffixidnumber = '_' . ++$counter;
              $currentidnumber = substr($idnumber, 0, 100 - strlen($suffixidnumber)).$suffixidnumber;
          }
  
          // Return the uniq idnumber.
          return $currentidnumber;
      }
code_tokens: public static function get_unused_idnumber ( $ idnumber ) { global $ DB ; $ currentidnumber = $ idnumber ; $ counter = 0 ; // Iteratere while the idnumber exists. while ( $ DB -> record_exists_select ( static :: TABLE , 'idnumber = ?' , array ( $ currentidnumber ) ) ) { $ suffixidnumber = '_' . ++ $ counter ; $ currentidnumber = substr ( $ idnumber , 0 , 100 - strlen ( $ suffixidnumber ) ) . $ suffixidnumber ; } // Return the uniq idnumber. return $ currentidnumber ; }
docstring: Get a uniq idnumber.
  
  @param string $idnumber the framework idnumber
  @return string
docstring_tokens: Get a uniq idnumber .