function EntityModerationRouteProvider::getEntityTypeIdKeyType
Same name in other branches
- 9 core/modules/content_moderation/src/Entity/Routing/EntityModerationRouteProvider.php \Drupal\content_moderation\Entity\Routing\EntityModerationRouteProvider::getEntityTypeIdKeyType()
- 10 core/modules/content_moderation/src/Entity/Routing/EntityModerationRouteProvider.php \Drupal\content_moderation\Entity\Routing\EntityModerationRouteProvider::getEntityTypeIdKeyType()
- 11.x core/modules/content_moderation/src/Entity/Routing/EntityModerationRouteProvider.php \Drupal\content_moderation\Entity\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 core/
modules/ content_moderation/ src/ Entity/ Routing/ EntityModerationRouteProvider.php - Gets the moderation-form route.
File
-
core/
modules/ content_moderation/ src/ Entity/ Routing/ EntityModerationRouteProvider.php, line 114
Class
- EntityModerationRouteProvider
- Dynamic route provider for the Content moderation module.
Namespace
Drupal\content_moderation\Entity\RoutingCode
protected function getEntityTypeIdKeyType(EntityTypeInterface $entity_type) {
if (!$entity_type->entityClassImplements(FieldableEntityInterface::class)) {
return NULL;
}
$field_storage_definitions = $this->entityFieldManager
->getFieldStorageDefinitions($entity_type->id());
return $field_storage_definitions[$entity_type->getKey('id')]
->getType();
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.