You are here

function devel_generate_content_kill in Devel 7

Same name and namespace in other branches
  1. 6 devel_generate.inc \devel_generate_content_kill()

Handle the devel_generate_content_form request to kill all of the content. This is used by both the batch and non-batch branches of the code.

Parameters

$num: array of options obtained from devel_generate_content_form.

2 calls to devel_generate_content_kill()
devel_generate_batch_content_kill in devel_generate/devel_generate_batch.inc
devel_generate_content in devel_generate/devel_generate.inc
The main API function for creating content.

File

devel_generate/devel_generate.inc, line 612

Code

function devel_generate_content_kill($values) {
  $results = db_select('node', 'n')
    ->fields('n', array(
    'nid',
  ))
    ->condition('type', $values['node_types'], 'IN')
    ->execute();
  foreach ($results as $result) {
    $nids[] = $result->nid;
  }
  if (!empty($nids)) {
    node_delete_multiple($nids);
    drupal_set_message(t('Deleted %count nodes.', array(
      '%count' => count($nids),
    )));
  }
}