You are here

function devel_generate_content_kill in Devel 6

Same name and namespace in other branches
  1. 7 devel_generate/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_batch.inc
Create Content Batch Functions:
devel_generate_content in ./devel_generate.inc
The main API function for creating content.

File

./devel_generate.inc, line 426

Code

function devel_generate_content_kill($results) {
  $sql = 'SELECT nid FROM {node} WHERE type IN (' . db_placeholders($results['node_types'], 'text') . ')';
  $result = db_query($sql, $results['node_types']);
  $i = 0;
  while ($row = db_fetch_object($result)) {
    node_delete($row->nid);
    $i++;
  }
  drupal_set_message(format_plural($i, 'Deleted one post', 'Deleted @count posts'));
}