Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. FieldResolver.php

function 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.

1 call to FieldResolver::getIdFieldName()
FieldResolver::getInternalName in core/modules/jsonapi/src/Context/FieldResolver.php
Resolves the internal field name based on a collection of resource types.

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');
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal