You are here

public function LinkCollection::getContext in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/jsonapi/src/JsonApiResource/LinkCollection.php \Drupal\jsonapi\JsonApiResource\LinkCollection::getContext()

Gets the LinkCollection's context object.

Return value

\Drupal\jsonapi\JsonApiResource\JsonApiDocumentTopLevel|\Drupal\jsonapi\JsonApiResource\ResourceObject|\Drupal\jsonapi\JsonApiResource\Relationship The LinkCollection's context.

File

core/modules/jsonapi/src/JsonApiResource/LinkCollection.php, line 131

Class

LinkCollection
Contains a set of JSON:API Link objects.

Namespace

Drupal\jsonapi\JsonApiResource

Code

public function getContext() {
  assert(!is_null($this->context), 'A LinkCollection is invalid unless a context has been established.');
  return $this->context;
}