public function ResourceIdentifier::withArity in JSON:API 8.2
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
- src/
JsonApiResource/ ResourceIdentifier.php, line 156
Class
- ResourceIdentifier
- Represents a JSON:API resource identifier object.
Namespace
Drupal\jsonapi\JsonApiResourceCode
public function withArity($arity) {
return new static($this
->getResourceType(), $this
->getId(), [
static::ARITY_KEY => $arity,
] + $this
->getMeta());
}