src/JsonApiResource/JsonApiDocumentTopLevel.php | 5 +++-- src/Normalizer/Value/JsonApiDocumentTopLevelNormalizerValue.php | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/JsonApiResource/JsonApiDocumentTopLevel.php b/src/JsonApiResource/JsonApiDocumentTopLevel.php index dc98c7e..1dd47ac 100644 --- a/src/JsonApiResource/JsonApiDocumentTopLevel.php +++ b/src/JsonApiResource/JsonApiDocumentTopLevel.php @@ -36,7 +36,8 @@ class JsonApiDocumentTopLevel { * The data to normalize. It can be either a straight up entity or a * collection of entities. * @param \Drupal\Core\Url[]|string[] $links - * The URLs to which to link. + * The URLs to which the top-level document should link. Keys are link + * relation types. Values are URLs. */ public function __construct($data, array $links) { assert(empty(array_diff(array_keys($links), ['self', 'first', 'next', 'prev', 'last', 'related']))); @@ -62,7 +63,7 @@ class JsonApiDocumentTopLevel { * Gets the links. * * @return \Drupal\Core\Url[] $links - * The document-level links. + * The top-level links. */ public function getLinks() { return $this->links; diff --git a/src/Normalizer/Value/JsonApiDocumentTopLevelNormalizerValue.php b/src/Normalizer/Value/JsonApiDocumentTopLevelNormalizerValue.php index 5bbaaad..6d8465b 100644 --- a/src/Normalizer/Value/JsonApiDocumentTopLevelNormalizerValue.php +++ b/src/Normalizer/Value/JsonApiDocumentTopLevelNormalizerValue.php @@ -26,6 +26,8 @@ class JsonApiDocumentTopLevelNormalizerValue implements ValueExtractorInterface, protected $values; /** + * The links. Keys are link relation types. + * * @var array|\Drupal\Core\Url[]|string[] */ protected $links;