public function RegistrantsElementUtility::addWhitelistExisting in RNG - Events and Registrations 8
Same name and namespace in other branches
- 8.2 src/RegistrantsElementUtility.php \Drupal\rng\RegistrantsElementUtility::addWhitelistExisting()
- 3.x src/RegistrantsElementUtility.php \Drupal\rng\RegistrantsElementUtility::addWhitelistExisting()
Whitelist an existing identity from re-validation.
Identities created by this element should avoid the existing check of EventMetaInterface::identitiesCanRegister in case the event type does not permit usage of the 'existing' subform.
Parameters
\Drupal\Core\Entity\EntityInterface $identity: An identity to whitelist from re-validation
File
- src/
RegistrantsElementUtility.php, line 140
Class
Namespace
Drupal\rngCode
public function addWhitelistExisting(EntityInterface $identity) {
$whitelisted = $this
->getWhitelistExisting();
$whitelisted[$identity
->getEntityTypeId()][$identity
->id()] = $identity
->id();
$this->formState
->set(array_merge($this->element['#parents'], [
'whitelist_existing',
]), $whitelisted);
}