You are here

public function ResourceTypeField::withPublicName in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/jsonapi/src/ResourceType/ResourceTypeField.php \Drupal\jsonapi\ResourceType\ResourceTypeField::withPublicName()
  2. 10 core/modules/jsonapi/src/ResourceType/ResourceTypeField.php \Drupal\jsonapi\ResourceType\ResourceTypeField::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.

1 call to ResourceTypeField::withPublicName()
ResourceTypeRelationship::withPublicName in core/modules/jsonapi/src/ResourceType/ResourceTypeRelationship.php
Establishes a new public name for the field.
1 method overrides ResourceTypeField::withPublicName()
ResourceTypeRelationship::withPublicName in core/modules/jsonapi/src/ResourceType/ResourceTypeRelationship.php
Establishes a new public name for the field.

File

core/modules/jsonapi/src/ResourceType/ResourceTypeField.php, line 94

Class

ResourceTypeField
Abstract value object containing all metadata for a JSON:API resource field.

Namespace

Drupal\jsonapi\ResourceType

Code

public function withPublicName($public_name) {
  return new static($this->internalName, $public_name, $this->enabled, $this->hasOne);
}