function registration_is_registered in Entity Registration 7.2
Same name and namespace in other branches
- 8.2 registration.module \registration_is_registered()
- 8 registration.module \registration_is_registered()
- 7 registration.module \registration_is_registered()
Determine if a person has an active registration for a host entity.
Parameters
Registration $registration: A fully loaded registration object.
string $mail: (optional) An email address.
Return value
bool
2 calls to registration_is_registered()
- RegistrationStandardTestCase::testRegistrationForm in tests/
registration.test - Tests for the registration add/edit form.
- registration_form_validate in includes/
registration.forms.inc - Validation callback for registration_form().
File
- ./
registration.module, line 1471
Code
function registration_is_registered(Registration $registration, $mail) {
// Must provide an email.
if (!$mail) {
return FALSE;
}
$registrations = registration_get_registrations($registration->entity_type, $registration->entity_id, $mail);
// Exclude existing registration.
if (isset($registration->registration_id)) {
unset($registrations[$registration->registration_id]);
}
return count($registrations) > 0;
}