You are here

class IncludedData in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/jsonapi/src/JsonApiResource/IncludedData.php \Drupal\jsonapi\JsonApiResource\IncludedData
  2. 9 core/modules/jsonapi/src/JsonApiResource/IncludedData.php \Drupal\jsonapi\JsonApiResource\IncludedData

Represents the included member of a JSON:API document.

@internal JSON:API maintains no PHP API. The API is the HTTP API. This class may change at any time and could break any dependencies on it.

Hierarchy

  • class \Drupal\jsonapi\JsonApiResource\IncludedData extends \Drupal\jsonapi\JsonApiResource\ResourceObjectData

Expanded class hierarchy of IncludedData

See also

https://www.drupal.org/project/drupal/issues/3032787

jsonapi.api.php

2 files declare their use of IncludedData
EntityResource.php in core/modules/jsonapi/src/Controller/EntityResource.php
IncludeResolver.php in core/modules/jsonapi/src/IncludeResolver.php

File

core/modules/jsonapi/src/JsonApiResource/IncludedData.php, line 17

Namespace

Drupal\jsonapi\JsonApiResource
View source
class IncludedData extends ResourceObjectData {

  /**
   * IncludedData constructor.
   *
   * @param \Drupal\jsonapi\JsonApiResource\ResourceObject[]|\Drupal\jsonapi\Exception\EntityAccessDeniedHttpException[] $data
   *   Resource objects that are the primary data for the response.
   *
   * @see \Drupal\jsonapi\JsonApiResource\Data::__construct
   */
  public function __construct($data) {
    assert(Inspector::assertAllObjects($data, ResourceObject::class, EntityAccessDeniedHttpException::class));
    parent::__construct($data, -1);
  }

}

Members