You are here

function node_limit_delete in Node Limit 7

Same name and namespace in other branches
  1. 8 old/node_limit.module \node_limit_delete()
  2. 6 node_limit.module \node_limit_delete()

Delete node limits

Parameters

$lid: The limit id.

$silent: Hide success message.

6 calls to node_limit_delete()
node_limit_delete_form_submit in ./node_limit.module
Submission hook for node limit deletion.
node_limit_role_user_role_delete in node_limit_role/node_limit_role.module
Implements hook_user_role_delete().
node_limit_save in ./node_limit.module
Callback to save a node limit back to the database.
node_limit_type_node_type_delete in node_limit_type/node_limit_type.module
Implements hook_node_type_delete().
node_limit_userofrole_user_role_delete in node_limit_userofrole/node_limit_userofrole.module
Implements hook_user_role_delete().

... See full list

File

./node_limit.module, line 684

Code

function node_limit_delete($lids, $silent = FALSE) {
  if (!is_array($lids)) {
    $lids = array(
      $lids,
    );
  }
  if (empty($lids)) {
    return;
  }
  $num = db_delete('node_limit')
    ->condition('lid', $lids, 'IN')
    ->execute();
  module_invoke_all('node_limit_delete', $lids);
  if ($num > 0 && !$silent) {
    drupal_set_message(t('Deleted !num.', array(
      '!num' => format_plural((int) $num, '1 limit rule', '@count limit rules'),
    )));
  }
}