You are here

public function RegistrantsElementUtility::addWhitelistExisting in RNG - Events and Registrations 8

Same name and namespace in other branches
  1. 8.2 src/RegistrantsElementUtility.php \Drupal\rng\RegistrantsElementUtility::addWhitelistExisting()
  2. 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

RegistrantsElementUtility

Namespace

Drupal\rng

Code

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);
}