You are here

function fusion_apply_skin_delete_multiple in Fusion Accelerator 7.2

Same name and namespace in other branches
  1. 7 fusion_apply/fusion_apply.module \fusion_apply_skin_delete_multiple()

Delete multiple skin configuration objects.

Parameters

$sids: An array of skin configuration IDs.

2 calls to fusion_apply_skin_delete_multiple()
fusion_apply_skin_delete in fusion_apply/fusion_apply.module
Delete a skin object.
fusion_apply_ui_multiple_delete_confirm_submit in fusion_apply/fusion_apply_ui.admin.inc
Form submission handler for fusion_apply_ui_multiple_delete_confirm().

File

fusion_apply/fusion_apply.module, line 463
Handles core Fusion Apply functionality.

Code

function fusion_apply_skin_delete_multiple($sids) {
  $transaction = db_transaction();
  if (!empty($sids)) {
    $skins = fusion_apply_skin_load_multiple($sids);
    try {
      foreach ($skins as $sid => $skin) {
        module_invoke_all('fusion_apply_skin_delete', $skin);
      }

      // Delete after calling hooks so that they can query node tables as needed.
      db_delete('fusion_apply_skins')
        ->condition('sid', $sids, 'IN')
        ->execute();
    } catch (Exception $e) {
      $transaction
        ->rollback();
      watchdog_exception('fusion_apply', $e);
      throw $e;
    }

    // Clear the fusion_apply_skin_load_multiple cache.
    drupal_static_reset('fusion_apply_skin_load_multiple');
  }
}