protected function EntityModerationRouteProvider::getEntityTypeIdKeyType in Workbench Moderation 8.2
Same name and namespace in other branches
- 8 src/Routing/EntityModerationRouteProvider.php \Drupal\workbench_moderation\Routing\EntityModerationRouteProvider::getEntityTypeIdKeyType()
Gets the type of the ID key for a given entity type.
Parameters
\Drupal\Core\Entity\EntityTypeInterface $entity_type: An entity type.
Return value
string|null The type of the ID key for a given entity type, or NULL if the entity type does not support fields.
1 call to EntityModerationRouteProvider::getEntityTypeIdKeyType()
- EntityModerationRouteProvider::getLatestVersionRoute in src/
Routing/ EntityModerationRouteProvider.php - Gets the moderation-form route.
File
- src/
Routing/ EntityModerationRouteProvider.php, line 109
Class
- EntityModerationRouteProvider
- Provides the following routes:
Namespace
Drupal\workbench_moderation\RoutingCode
protected function getEntityTypeIdKeyType(EntityTypeInterface $entity_type) {
if (!$entity_type
->isSubclassOf(FieldableEntityInterface::class)) {
return NULL;
}
$field_storage_definitions = $this->entityFieldManager
->getFieldStorageDefinitions($entity_type
->id());
return $field_storage_definitions[$entity_type
->getKey('id')]
->getType();
}