original_string: public static function export_user_preferences(int $userid) {
          $preferences = get_user_preferences(null, null, $userid);
          foreach ($preferences as $name => $value) {
              if (
                  (substr($name, 0, 16) == 'message_provider') ||
                  ($name == 'message_blocknoncontacts') ||
                  ($name == 'message_entertosend')
              ) {
                  writer::export_user_preference(
                      'core_message',
                      $name,
                      $value,
                      get_string('privacy:request:preference:set', 'core_message', (object) [
                          'name' => $name,
                          'value' => $value,
                      ])
                  );
              }
          }
      }
code: public static function export_user_preferences(int $userid) {
          $preferences = get_user_preferences(null, null, $userid);
          foreach ($preferences as $name => $value) {
              if (
                  (substr($name, 0, 16) == 'message_provider') ||
                  ($name == 'message_blocknoncontacts') ||
                  ($name == 'message_entertosend')
              ) {
                  writer::export_user_preference(
                      'core_message',
                      $name,
                      $value,
                      get_string('privacy:request:preference:set', 'core_message', (object) [
                          'name' => $name,
                          'value' => $value,
                      ])
                  );
              }
          }
      }
code_tokens: public static function export_user_preferences ( int $ userid ) { $ preferences = get_user_preferences ( null , null , $ userid ) ; foreach ( $ preferences as $ name => $ value ) { if ( ( substr ( $ name , 0 , 16 ) == 'message_provider' ) || ( $ name == 'message_blocknoncontacts' ) || ( $ name == 'message_entertosend' ) ) { writer :: export_user_preference ( 'core_message' , $ name , $ value , get_string ( 'privacy:request:preference:set' , 'core_message' , ( object ) [ 'name' => $ name , 'value' => $ value , ] ) ) ; } } }
docstring: Store all user preferences for core message.
  
  @param  int $userid The userid of the user whose data is to be exported.
docstring_tokens: Store all user preferences for core message .