original_string: protected static function export_user_devices(int $userid, \context $context) {
          global $DB;
          $records = $DB->get_records('user_devices', ['userid' => $userid]);
          if (!empty($records)) {
              $userdevices = (object) array_map(function($record) {
                  return [
                      'appid' => $record->appid,
                      'name' => $record->name,
                      'model' => $record->model,
                      'platform' => $record->platform,
                      'version' => $record->version,
                      'timecreated' => transform::datetime($record->timecreated),
                      'timemodified' => transform::datetime($record->timemodified)
                  ];
              }, $records);
              writer::with_context($context)->export_data([get_string('privacy:devicespath', 'user')], $userdevices);
          }
      }
code: protected static function export_user_devices(int $userid, \context $context) {
          global $DB;
          $records = $DB->get_records('user_devices', ['userid' => $userid]);
          if (!empty($records)) {
              $userdevices = (object) array_map(function($record) {
                  return [
                      'appid' => $record->appid,
                      'name' => $record->name,
                      'model' => $record->model,
                      'platform' => $record->platform,
                      'version' => $record->version,
                      'timecreated' => transform::datetime($record->timecreated),
                      'timemodified' => transform::datetime($record->timemodified)
                  ];
              }, $records);
              writer::with_context($context)->export_data([get_string('privacy:devicespath', 'user')], $userdevices);
          }
      }
code_tokens: protected static function export_user_devices ( int $ userid , \ context $ context ) { global $ DB ; $ records = $ DB -> get_records ( 'user_devices' , [ 'userid' => $ userid ] ) ; if ( ! empty ( $ records ) ) { $ userdevices = ( object ) array_map ( function ( $ record ) { return [ 'appid' => $ record -> appid , 'name' => $ record -> name , 'model' => $ record -> model , 'platform' => $ record -> platform , 'version' => $ record -> version , 'timecreated' => transform :: datetime ( $ record -> timecreated ) , 'timemodified' => transform :: datetime ( $ record -> timemodified ) ] ; } , $ records ) ; writer :: with_context ( $ context ) -> export_data ( [ get_string ( 'privacy:devicespath' , 'user' ) ] , $ userdevices ) ; } }
docstring: Exports information about the user's mobile devices.
  
  @param  int $userid The user ID.
  @param  \context $context Context for this user.
docstring_tokens: Exports information about the user s mobile devices .