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\JsonApiResourceCode
public function withArity($arity) {
return new static($this->getResourceType(), $this->getId(), [
static::ARITY_KEY => $arity,
] + $this->getMeta());
}