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