Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. ResourceIdentifier.php

function ResourceIdentifier::withArity

Returns a copy of the given ResourceIdentifier with the given arity.

Parameters

int $arity: The new arity; must be a non-negative integer.

Return value

static A newly created ResourceIdentifier with the given arity, otherwise the same.

File

core/modules/jsonapi/src/JsonApiResource/ResourceIdentifier.php, line 156

Class

ResourceIdentifier
Represents a JSON:API resource identifier object.

Namespace

Drupal\jsonapi\JsonApiResource

Code

public function withArity($arity) {
    return new static($this->getResourceType(), $this->getId(), [
        static::ARITY_KEY => $arity,
    ] + $this->getMeta());
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal