You are here

public function RegistrantsElementUtility::addWhitelistExisting in RNG - Events and Registrations 3.x

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

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