function party_devel_generate_parties_kill in Party 8.2
Same name and namespace in other branches
- 7 modules/party_devel/devel_generate.inc \party_devel_generate_parties_kill()
Handle the party_devel_generate_parties_form request to kill all of the existing products.
This is used by both the batch and non-batch branches of the code.
Parameters
$values: array of options obtained from commerce_devel_generate_products_form.
2 calls to party_devel_generate_parties_kill()
- party_devel_generate_batch_parties_kill in modules/
party_devel/ devel_generate_batch.inc - Create Product Batch Functions:
- party_devel_generate_parties in modules/
party_devel/ devel_generate.inc - The main API function for creating parties
File
- modules/
party_devel/ devel_generate.inc, line 47 - Devel generate code.
Code
function party_devel_generate_parties_kill($values) {
$results = db_select('party', 'p')
->fields('p', array(
'pid',
))
->execute();
foreach ($results as $result) {
$party_ids[] = $result->pid;
}
if (!empty($party_ids)) {
party_delete_multiple($party_ids);
drupal_set_message(t('Deleted %count parties.', array(
'%count' => count($party_ids),
)));
}
}