function ResourceType::getFieldByPublicName
Same name in other branches
- 9 core/modules/jsonapi/src/ResourceType/ResourceType.php \Drupal\jsonapi\ResourceType\ResourceType::getFieldByPublicName()
- 8.9.x core/modules/jsonapi/src/ResourceType/ResourceType.php \Drupal\jsonapi\ResourceType\ResourceType::getFieldByPublicName()
- 11.x 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.
1 call to ResourceType::getFieldByPublicName()
- ResourceType::getRelatableResourceTypesByField in core/
modules/ jsonapi/ src/ ResourceType/ ResourceType.php - Get all resource types with which the given field may have a relationship.
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;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.