protected function EventType::getIdentityTypeKey in RNG - Events and Registrations 8
Get the array key of the people type.
Parameters
string $entity_type: The identity entity type ID.
string $bundle: The identity bundle.
boolean $create_key: Will initialise the array key.
Return value
int|FALSE The array key, or FALSE if it does not exist.
6 calls to EventType::getIdentityTypeKey()
- EventType::canIdentityTypeCreate in src/
Entity/ EventType.php - Whether a identity type can be created.
- EventType::canIdentityTypeReference in src/
Entity/ EventType.php - Whether an existing identity type can be referenced.
- EventType::getIdentityTypeEntityFormMode in src/
Entity/ EventType.php - Get the form display mode used when the identity is created inline.
- EventType::setIdentityTypeCreate in src/
Entity/ EventType.php - Set whether an identity type can be created.
- EventType::setIdentityTypeEntityFormMode in src/
Entity/ EventType.php - Set the form display mode used when the identity is created inline.
File
- src/
Entity/ EventType.php, line 273
Class
- EventType
- Defines the event type entity.
Namespace
Drupal\rng\EntityCode
protected function getIdentityTypeKey($entity_type, $bundle, $create_key = TRUE) {
if (isset($this->people_types)) {
$pairs = $this->people_types;
foreach ($pairs as $k => $pair) {
if ($pair['entity_type'] == $entity_type && $pair['bundle'] == $bundle) {
return $k;
}
}
}
if ($create_key) {
// Create if it doesn't exist.
$next_key = count($this->people_types) + 1;
$this->people_types[$next_key] = [
'entity_type' => $entity_type,
'bundle' => $bundle,
];
return $next_key;
}
return FALSE;
}