You are here

function bat_unit_delete_multiple in Booking and Availability Management Tools for Drupal 8

Same name and namespace in other branches
  1. 7 modules/bat_unit/bat_unit.module \bat_unit_delete_multiple()

Deletes multiple units.

Parameters

array $unit_ids: An array of unit IDs.

1 call to bat_unit_delete_multiple()
UnitDeleteMultiple::submitForm in modules/bat_unit/src/Form/UnitDeleteMultiple.php
Form submission handler.

File

modules/bat_unit/bat_unit.module, line 363
Manage units - Units are things that can be booked for some period of time. (e.g. rooms - but also villas bungalows, cars, drills, you-get-the-idea etc.)

Code

function bat_unit_delete_multiple(array $unit_ids) {
  $units = Unit::loadMultiple($unit_ids);
  foreach ($units as $unit) {
    $unit
      ->delete();
  }
}