protected static function delete_data(int $userid) {
        global $DB;

        foreach (static::get_records($userid) as $record) {
            $DB->delete_records('message_airnotifier_devices', ['id' => $record->id]);
        }
    }
protected static function delete_data(int $userid) {
        global $DB;

        foreach (static::get_records($userid) as $record) {
            $DB->delete_records('message_airnotifier_devices', ['id' => $record->id]);
        }
    }
protected static function delete_data ( int $ userid ) { global $ DB ; foreach ( static :: get_records ( $ userid ) as $ record ) { $ DB -> delete_records ( 'message_airnotifier_devices' , [ 'id' => $ record -> id ] ) ; } }
Delete data related to a userid.

@param int $userid The user ID
Delete data related to a userid .