public function Registration::hasIdentity in RNG - Events and Registrations 8.2
Same name and namespace in other branches
- 8 src/Entity/Registration.php \Drupal\rng\Entity\Registration::hasIdentity()
- 3.x src/Entity/Registration.php \Drupal\rng\Entity\Registration::hasIdentity()
Searches registrants on this registration for an identity.
Parameters
\Drupal\Core\Entity\EntityInterface $identity: The identity to search.
Return value
bool Whether the identity is a registrant.
Overrides RegistrationInterface::hasIdentity
1 call to Registration::hasIdentity()
- Registration::addIdentity in src/
Entity/ Registration.php - Shortcut to add a registrant entity.
File
- src/
Entity/ Registration.php, line 224
Class
- Registration
- Defines the registration entity class.
Namespace
Drupal\rng\EntityCode
public function hasIdentity(EntityInterface $identity) {
foreach ($this->identities_unsaved as $identity_unsaved) {
if ($identity == $identity_unsaved) {
return TRUE;
}
}
foreach ($this
->getRegistrants() as $registrant) {
if ($registrant
->hasIdentity($identity)) {
return TRUE;
}
}
return FALSE;
}