public function ResourceType::getFieldByPublicName in Drupal 10
Same name and namespace in other branches
- 8 core/modules/jsonapi/src/ResourceType/ResourceType.php \Drupal\jsonapi\ResourceType\ResourceType::getFieldByPublicName()
- 9 core/modules/jsonapi/src/ResourceType/ResourceType.php \Drupal\jsonapi\ResourceType\ResourceType::getFieldByPublicName()
Gets a particular attribute or relationship field by public field name.
Parameters
string $public_field_name: The public 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.
File
- core/
modules/ jsonapi/ src/ ResourceType/ ResourceType.php, line 200
Class
- ResourceType
- Value object containing all metadata for a JSON:API resource type.
Namespace
Drupal\jsonapi\ResourceTypeCode
public function getFieldByPublicName($public_field_name) {
return isset($this->fieldMapping[$public_field_name]) ? $this
->getFieldByInternalName($this->fieldMapping[$public_field_name]) : NULL;
}