function ResourceTypeField::withPublicName

Same name and namespace in other branches
  1. 8.9.x 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()
  3. 11.x 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);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.