function LinkCollection::withContext
Same name in other branches
- 9 core/modules/jsonapi/src/JsonApiResource/LinkCollection.php \Drupal\jsonapi\JsonApiResource\LinkCollection::withContext()
- 8.9.x core/modules/jsonapi/src/JsonApiResource/LinkCollection.php \Drupal\jsonapi\JsonApiResource\LinkCollection::withContext()
- 11.x core/modules/jsonapi/src/JsonApiResource/LinkCollection.php \Drupal\jsonapi\JsonApiResource\LinkCollection::withContext()
Establishes a new context for a LinkCollection.
Parameters
\Drupal\jsonapi\JsonApiResource\JsonApiDocumentTopLevel|\Drupal\jsonapi\JsonApiResource\ResourceObject|\Drupal\jsonapi\JsonApiResource\Relationship $context: The new context object.
Return value
static A new LinkCollection with the given context.
File
-
core/
modules/ jsonapi/ src/ JsonApiResource/ LinkCollection.php, line 122
Class
- LinkCollection
- Contains a set of JSON:API Link objects.
Namespace
Drupal\jsonapi\JsonApiResourceCode
public function withContext($context) {
return new static($this->links, $context);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.