Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Relationship.php

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;

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal