function merci_reservation_items in MERCI (Manage Equipment Reservations, Checkout and Inventory) 7.2
Same name and namespace in other branches
- 6.2 includes/database.inc \merci_reservation_items()
- 7.3 merci_migrate/merci_line_item.inc \merci_reservation_items()
@todo Please document this function.
See also
1 call to merci_reservation_items()
- merci_load in ./
merci.module - Implements hook_load().
2 string references to 'merci_reservation_items'
- merci_form in ./
merci.module - Implementation of hook_form().
- merci_form_alter in ./
merci.module - Implementation of hook_form_alter().
File
- includes/
database.inc, line 158 - MERCI - Managed Equipment Reservation Checkout and Inventory
Code
function merci_reservation_items($node) {
$items = db_query("SELECT m.did, m.merci_item_status, merci_placeholder_nid, pn.title AS placeholder_title, merci_item_nid, tn.title AS item_title, nt.type, nt.name FROM {merci_reservation_detail} m INNER JOIN {node} pn ON m.merci_placeholder_nid = pn.nid INNER JOIN {node_type} nt ON pn.type = nt.type LEFT JOIN {node} tn ON m.merci_item_nid = tn.nid WHERE m.vid = :vid", array(
':vid' => $node->vid,
));
$reservation_items = array();
foreach ($items as $item) {
$item = (array) $item;
$reservation_items[$item['did']] = $item;
}
return $reservation_items;
}