function merci_check_existing_bucket_items in MERCI (Manage Equipment Reservations, Checkout and Inventory) 6
Check for existing items in a bucket.
Parameters
$type: The bucket node type.
$status: TRUE to restrict to published items, FALSE otherwise.
Return value
TRUE if any items exist, FALSE otherwise.
2 calls to merci_check_existing_bucket_items()
- merci_build_reservable_items in ./
merci.module - Builds the list of all currently reservable items, filtered by date.
- merci_form_alter in ./
merci.module - Implementation of hook_form_alter().
File
- ./
merci.module, line 2771 - MERCI - Managed Equipment Reservation Checkout and Inventory
Code
function merci_check_existing_bucket_items($type, $status = FALSE) {
$where = $status ? ' AND status = 1' : '';
$existing_items = db_result(db_query("SELECT nid FROM {node} WHERE type = '%s'{$where}", $type));
return $existing_items;
}