Relationship::$context

Same name and namespace in other branches
  1. 8.9.x core/modules/jsonapi/src/JsonApiResource/Relationship.php \Drupal\jsonapi\JsonApiResource\Relationship::context
  2. 10 core/modules/jsonapi/src/JsonApiResource/Relationship.php \Drupal\jsonapi\JsonApiResource\Relationship::context
  3. 11.x core/modules/jsonapi/src/JsonApiResource/Relationship.php \Drupal\jsonapi\JsonApiResource\Relationship::context

The context resource object of the relationship.

A relationship object represents references from a resource object in which it’s defined to other resource objects. Respectively, the "context" of the relationship and the "target(s)" of the relationship.

A relationship object's context either comes from the resource object that contains it or, in the case that the relationship object is accessed directly via a relationship URL, from its `self` URL, which should identify the resource to which it belongs.

Type: \Drupal\jsonapi\JsonApiResource\ResourceObject

See also

https://jsonapi.org/format/#document-resource-object-relationships

https://jsonapi.org/recommendations/#urls-relationships

File

core/modules/jsonapi/src/JsonApiResource/Relationship.php, line 41

Class

Relationship
Represents references from one resource object to other resource object(s).

Namespace

Drupal\jsonapi\JsonApiResource

Code

protected $context;

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.