function 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;
}

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