Mercurial > hg > cmmr2012-drupal-site
comparison core/modules/jsonapi/src/JsonApiResource/IncludedData.php @ 5:12f9dff5fda9 tip
Update to Drupal core 8.7.1
author | Chris Cannam |
---|---|
date | Thu, 09 May 2019 15:34:47 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
4:a9cd425dd02b | 5:12f9dff5fda9 |
---|---|
1 <?php | |
2 | |
3 namespace Drupal\jsonapi\JsonApiResource; | |
4 | |
5 use Drupal\Component\Assertion\Inspector; | |
6 use Drupal\jsonapi\Exception\EntityAccessDeniedHttpException; | |
7 | |
8 /** | |
9 * Represents the included member of a JSON:API document. | |
10 * | |
11 * @internal JSON:API maintains no PHP API. The API is the HTTP API. This class | |
12 * may change at any time and could break any dependencies on it. | |
13 * | |
14 * @see https://www.drupal.org/project/jsonapi/issues/3032787 | |
15 * @see jsonapi.api.php | |
16 */ | |
17 class IncludedData extends ResourceObjectData { | |
18 | |
19 /** | |
20 * IncludedData constructor. | |
21 * | |
22 * @param \Drupal\jsonapi\JsonApiResource\ResourceObject[]|\Drupal\jsonapi\Exception\EntityAccessDeniedHttpException[] $data | |
23 * Resource objects that are the primary data for the response. | |
24 * | |
25 * @see \Drupal\jsonapi\JsonApiResource\Data::__construct | |
26 */ | |
27 public function __construct($data) { | |
28 assert(Inspector::assertAllObjects($data, ResourceObject::class, EntityAccessDeniedHttpException::class)); | |
29 parent::__construct($data, -1); | |
30 } | |
31 | |
32 } |