public function EventMeta::getCreatableIdentityTypes in RNG - Events and Registrations 8.2
Same name and namespace in other branches
- 8 src/EventMeta.php \Drupal\rng\EventMeta::getCreatableIdentityTypes()
- 3.x src/EventMeta.php \Drupal\rng\EventMeta::getCreatableIdentityTypes()
Get identity types which can be created 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::getCreatableIdentityTypes
1 call to EventMeta::getCreatableIdentityTypes()
- EventMeta::canRegisterProxyIdentities in src/
EventMeta.php - Determine if the current user has proxy register access.
File
- src/
EventMeta.php, line 585
Class
- EventMeta
- Meta event wrapper for RNG.
Namespace
Drupal\rngCode
public function getCreatableIdentityTypes() {
$event_type = $this
->getEventType();
$result = [];
$identity_types_available = $this->rngConfiguration
->getIdentityTypes();
foreach ($identity_types_available as $entity_type_id) {
$bundles = $this->entityManager
->getBundleInfo($entity_type_id);
foreach ($bundles as $bundle => $info) {
if ($event_type
->canIdentityTypeCreate($entity_type_id, $bundle)) {
$result[$entity_type_id][] = $bundle;
}
}
}
return $result;
}