function skinr_context_group_delete_multiple in Skinr 8.2
Same name and namespace in other branches
- 7.2 skinr_context/skinr_context.module \skinr_context_group_delete_multiple()
Delete multiple skin settings group objects.
Parameters
$gids: An array of skin settings group IDs.
2 calls to skinr_context_group_delete_multiple()
- SkinrContextApiTestCase::testSkinrContextGroupLoadSave in skinr_context/
tests/ skinr_context.test - Test skinr_skin_save() against invalid entries.
- skinr_context_group_delete in skinr_context/
skinr_context.module - Delete a skin group object.
File
- skinr_context/
skinr_context.module, line 140 - Provides Skinr integration with Context.
Code
function skinr_context_group_delete_multiple($gids) {
$transaction = db_transaction();
if (!empty($gids)) {
$groups = skinr_context_group_load_multiple($gids);
try {
foreach ($groups as $gid => $group) {
module_invoke_all('skinr_context_group_delete', $group);
// Delete all skin settings associated with this group.
$params = array(
'gid' => $gid,
);
$sids = skinr_context_group_get_sids($params);
entity_delete_multiple('skin', $sids);
}
// Delete after calling hooks so that they can query node tables as needed.
db_delete('skinr_groups')
->condition('gid', $gids, 'IN')
->execute();
} catch (Exception $e) {
$transaction
->rollback();
watchdog_exception('skinr', $e);
throw $e;
}
// Clear the skinr_context_group_load_multiple cache.
drupal_static_reset('skinr_context_group_load_multiple');
// Clear context's cache.
context_invalidate_cache();
}
}