You are here

public function EventMeta::getIdentityTypes in RNG - Events and Registrations 3.x

Same name and namespace in other branches
  1. 8.2 src/EventMeta.php \Drupal\rng\EventMeta::getIdentityTypes()
  2. 8 src/EventMeta.php \Drupal\rng\EventMeta::getIdentityTypes()

Get identity types which can be referenced for this event.

The types returned are guaranteed to exist in the system. Invalid configuration such as no-longer existing bundles or entity types are filtered out.

Return value

array Array of bundles keyed by entity type.

Overrides EventMetaInterface::getIdentityTypes

3 calls to EventMeta::getIdentityTypes()
EventMeta::canRegisterProxyIdentities in src/EventMeta.php
Determine if the current user has proxy register access.
EventMeta::countProxyIdentities in src/EventMeta.php
Count number of identities the current user has proxy register access.
EventMeta::identitiesCanRegister in src/EventMeta.php
Determine if identities can register.

File

src/EventMeta.php, line 574

Class

EventMeta
Meta event wrapper for RNG.

Namespace

Drupal\rng

Code

public function getIdentityTypes() {
  $event_type = $this
    ->getEventType();
  $result = [];
  $identity_types_available = $this->rngConfiguration
    ->getIdentityTypes();
  foreach ($identity_types_available as $entity_type_id) {
    $bundles = $this->bundleInfo
      ->getBundleInfo($entity_type_id);
    foreach ($bundles as $bundle => $info) {
      if ($event_type
        ->canIdentityTypeReference($entity_type_id, $bundle)) {
        $result[$entity_type_id][] = $bundle;
      }
    }
  }
  return $result;
}