You are here

function _node_registration_get_waitinglist in Node registration 7

The current, active waitinglist of an event.

File

includes/node_registration.api.inc, line 128
Registration API functions.

Code

function _node_registration_get_waitinglist($node) {
  $ids = db_select('node_registration', 'r')
    ->fields('r', array(
    'registration_id',
  ))
    ->condition('nid', $node->nid)
    ->condition('cancelled', 0)
    ->condition('waitinglist', 1)
    ->execute()
    ->fetchColumn();
  $registrations = node_registration_load_multiple($ids);
  ksort($registrations, SORT_NUMERIC);
  return $registrations;
}