function _node_registration_event_has_room in Node registration 7
Helper to determine if a node has any slots left.
3 calls to _node_registration_event_has_room()
- node_registration_access in includes/
node_registration.api.inc - All Registration access callbacks. Just like node.module has node_access.
- node_registration_form in includes/
node_registration.forms.inc - The registration form. It takes a (mandatory) existing or empty registration object.
- node_registration_form_validate in includes/
node_registration.forms.inc - Validation handler for node_registration_form().
File
- includes/
node_registration.api.inc, line 681 - Registration API functions.
Code
function _node_registration_event_has_room($node) {
if ($node->registration
->enabled()) {
$capacity = $node->registration
->capacity();
$registrations = node_registration_event_count($node);
return !$capacity || $capacity > $registrations;
}
return FALSE;
}