You are here

public function ResourceTypeRelationship::withPublicName in Drupal 9

Same name and namespace in other branches
  1. 8 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\ResourceType

Code

public function withPublicName($public_name) {
  $relationship = parent::withPublicName($public_name);
  return isset($this->relatableResourceTypes) ? $relationship
    ->withRelatableResourceTypes($this->relatableResourceTypes) : $relationship;
}