You are here

public function ResourceType::getFieldByInternalName in Drupal 9

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

Gets a particular attribute or relationship field by internal field name.

Parameters

string $internal_field_name: The internal field name of the desired field.

Return value

\Drupal\jsonapi\ResourceType\ResourceTypeField|null A resource type field object or NULL if the field does not exist on this resource type.

1 call to ResourceType::getFieldByInternalName()
ResourceType::getFieldByPublicName in core/modules/jsonapi/src/ResourceType/ResourceType.php
Gets a particular attribute or relationship field by public field name.

File

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

Class

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

Namespace

Drupal\jsonapi\ResourceType

Code

public function getFieldByInternalName($internal_field_name) {
  return $this->fields[$internal_field_name] ?? NULL;
}