function registration_checkin_get_all_registrations in Entity Registration 7.2
Get all registrants for a specific host entity.
Parameters
int $host_entity_id: The unique entity identifier for the host entity.
string $host_entity_type: The machine name of the entity type.
int $pager_size: The pager size of the query result. Omit this to remove the pager.
Return value
array | bool An array of loaded Registration entities, or FALSE if there are no registrations for the host entity.
3 calls to registration_checkin_get_all_registrations()
- registration_checkin_list_page in modules/
registration_checkin/ registration_checkin.pages.inc - Page callback: Show a list of active registrations that can be checked in.
- registration_checkin_search_form_reset in modules/
registration_checkin/ registration_checkin.module - AJAX callback to reset the checkin table back to an unfiltered state.
- registration_checkin_search_form_submit in modules/
registration_checkin/ registration_checkin.module - AJAX callback to update the registrant checkin table based on a search query.
File
- modules/
registration_checkin/ registration_checkin.module, line 343 - Entity Registration registrant checkin workflow and UI for registration.
Code
function registration_checkin_get_all_registrations($host_entity_id, $host_entity_type, $pager_size = FALSE) {
$query = new EntityFieldQuery();
$query
->entityCondition('entity_type', 'registration')
->propertyCondition('entity_id', $host_entity_id)
->propertyCondition('entity_type', $host_entity_type)
->propertyOrderBy('created', 'DESC');
if ($pager_size) {
$query
->pager((int) $pager_size);
}
$result = $query
->execute();
if (!empty($result['registration'])) {
return registration_load_multiple(array_keys($result['registration']));
}
else {
return FALSE;
}
}