You are here

function node_limit_delete in Node Limit 8

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

Delete node limits.

Parameters

array|int $lids: The limit id.

bool $silent: Hide success message.

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

... See full list

File

old/node_limit.module, line 652

Code

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