function ResourceType::getPublicName
Same name in other branches
- 9 core/modules/jsonapi/src/ResourceType/ResourceType.php \Drupal\jsonapi\ResourceType\ResourceType::getPublicName()
- 8.9.x core/modules/jsonapi/src/ResourceType/ResourceType.php \Drupal\jsonapi\ResourceType\ResourceType::getPublicName()
- 11.x core/modules/jsonapi/src/ResourceType/ResourceType.php \Drupal\jsonapi\ResourceType\ResourceType::getPublicName()
Translates the entity field name to the public 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 public field name.
File
-
core/
modules/ jsonapi/ src/ ResourceType/ ResourceType.php, line 159
Class
- ResourceType
- Value object containing all metadata for a JSON:API resource type.
Namespace
Drupal\jsonapi\ResourceTypeCode
public function getPublicName($field_name) {
// By default the entity field name is the public field name.
return isset($this->fields[$field_name]) ? $this->fields[$field_name]
->getPublicName() : $field_name;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.