You are here

protected function FieldResolver::getIdFieldName in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/jsonapi/src/Context/FieldResolver.php \Drupal\jsonapi\Context\FieldResolver::getIdFieldName()
  2. 9 core/modules/jsonapi/src/Context/FieldResolver.php \Drupal\jsonapi\Context\FieldResolver::getIdFieldName()

Resolves the UUID field name for a resource type.

Parameters

\Drupal\jsonapi\ResourceType\ResourceType $resource_type: The resource type for which to get the UUID field name.

Return value

string The resolved internal name.

File

core/modules/jsonapi/src/Context/FieldResolver.php, line 507

Class

FieldResolver
A service that evaluates external path expressions against Drupal fields.

Namespace

Drupal\jsonapi\Context

Code

protected function getIdFieldName(ResourceType $resource_type) {
  $entity_type = $this->entityTypeManager
    ->getDefinition($resource_type
    ->getEntityTypeId());
  return $entity_type
    ->getKey('uuid');
}