public function RegistrantsElementUtility::identityExists in RNG - Events and Registrations 8
Same name and namespace in other branches
- 8.2 src/RegistrantsElementUtility.php \Drupal\rng\RegistrantsElementUtility::identityExists()
- 3.x src/RegistrantsElementUtility.php \Drupal\rng\RegistrantsElementUtility::identityExists()
Determine if an identity is already used.
Parameters
\Drupal\Core\Entity\EntityInterface $identity: An identity to check.
Return value
boolean Whether the identity is already used.
1 call to RegistrantsElementUtility::identityExists()
- RegistrantsElementUtility::peopleTypeOptions in src/
RegistrantsElementUtility.php - Generate available people type options suitable for radios element.
File
- src/
RegistrantsElementUtility.php, line 296
Class
Namespace
Drupal\rngCode
public function identityExists(EntityInterface $identity) {
$registrants = $this
->getRegistrants();
foreach ($registrants as $registrant) {
if ($registrant
->getIdentity()
->id() == $identity
->id() && $registrant
->getIdentity()
->getEntityTypeId() == $identity
->getEntityTypeId()) {
return TRUE;
}
}
return FALSE;
}