public function ResourceTypeRelationship::withPublicName in Drupal 8
Same name and namespace in other branches
- 9 core/modules/jsonapi/src/ResourceType/ResourceTypeRelationship.php \Drupal\jsonapi\ResourceType\ResourceTypeRelationship::withPublicName()
Establishes a new public name for the field.
Parameters
string $public_name: The public name.
Return value
static A new instance of the field with the given public name.
Overrides ResourceTypeField::withPublicName
File
- core/
modules/ jsonapi/ src/ ResourceType/ ResourceTypeRelationship.php, line 56
Class
- ResourceTypeRelationship
- Specialization of a ResourceTypeField to represent a resource relationship.
Namespace
Drupal\jsonapi\ResourceTypeCode
public function withPublicName($public_name) {
$relationship = parent::withPublicName($public_name);
return isset($this->relatableResourceTypes) ? $relationship
->withRelatableResourceTypes($this->relatableResourceTypes) : $relationship;
}