You are here

public function ResourceType::getInternalName in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/jsonapi/src/ResourceType/ResourceType.php \Drupal\jsonapi\ResourceType\ResourceType::getInternalName()
  2. 10 core/modules/jsonapi/src/ResourceType/ResourceType.php \Drupal\jsonapi\ResourceType\ResourceType::getInternalName()

Translates the public field name to the entity field name.

This is only here so we can allow polymorphic implementations to take a greater control on the field names.

Return value

string The internal field name as defined in the entity.

File

core/modules/jsonapi/src/ResourceType/ResourceType.php, line 175

Class

ResourceType
Value object containing all metadata for a JSON:API resource type.

Namespace

Drupal\jsonapi\ResourceType

Code

public function getInternalName($field_name) {

  // By default the entity field name is the public field name.
  return $this->fieldMapping[$field_name] ?? $field_name;
}