deleteAllFrom method

Future<bool> deleteAllFrom(
  1. RoomType roomType,
  2. List<int> keys, {
  3. int? playlistKey,
})

Used to delete all defined entities from a specific room.

Parameters:

  • roomType this will define which room will be cleaned.
  • keys this will define all entities that will be deleted.
  • playlistKey this will be the id/key of the playlist *.

* playlistKey it's only required when using RoomType.PLAYLIST.

Return:

  • If all defined entities was deleted, will return true, if not, will return false.

See too:

Implementation

Future<bool> deleteAllFrom(
  RoomType roomType,
  List<int> keys, {
  int? playlistKey,
}) async {
  if (roomType == RoomType.PLAYLIST && playlistKey == null) {
    throw Exception(
      "Cannot add [entity] to a undefined [playlist]\n"
      "Define the [playlistKey] parameter.",
    );
  }
  return await _controller.deleteAllFromController(
    roomType,
    keys,
    playlistKey: playlistKey,
  );
}