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,
                    ])
                );
            }
        }
    }
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,
                    ])
                );
            }
        }
    }
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 , ] ) ) ; } } }
Store all user preferences for core message.

@param  int $userid The userid of the user whose data is to be exported.
Store all user preferences for core message .