You are here

function _node_registration_user_registered in Node registration 7

Retrieves existing registration for a certain user (in a certain event).

4 calls to _node_registration_user_registered()
node_registration_access in includes/node_registration.api.inc
All Registration access callbacks. Just like node.module has node_access.
node_registration_block_view in ./node_registration.module
Implements hook_block_view().
node_registration_node_access in includes/node_registration.api.inc
Implements hook_node_access().
node_registration_register_other_access in ./node_registration.module
Access callback to check if current user can register other user.

File

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

Code

function _node_registration_user_registered($node, $account = NULL) {
  global $user;
  $account or $account = $user;
  if ($account->uid) {
    $registrations = $registrations = node_registration_load_multiple(FALSE, array(
      'uid' => $account->uid,
      'nid' => $node->nid,
      'cancelled' => 0,
    ));
    if ($registrations) {
      return reset($registrations);
    }
  }
}