You are here

public function LinkCollection::withContext in JSON:API 8.2

Establishes a new context for a LinkCollection.

Parameters

\Drupal\jsonapi\JsonApiResource\JsonApiDocumentTopLevel|\Drupal\jsonapi\JsonApiResource\ResourceObject $context: The new context object.

Return value

static A new LinkCollection with the given context.

File

src/JsonApiResource/LinkCollection.php, line 120

Class

LinkCollection
Contains a set of JSON:API Link objects.

Namespace

Drupal\jsonapi\JsonApiResource

Code

public function withContext($context) {
  return new static($this->links, $context);
}