You are here

public function LinkProviderInterface::getLink in JSON:API Hypermedia 8

Adds, alters or removes hyperlinks from a link collection.

Parameters

\Drupal\jsonapi\JsonApiResource\JsonApiDocumentTopLevel|\Drupal\jsonapi\JsonApiResource\ResourceObject|\Drupal\jsonapi\JsonApiResource\Relationship $context: The context object from which links should be generated.

Return value

\Drupal\jsonapi_hypermedia\AccessRestrictedLink A link to be added to the context object. An AccessRestrictedLink should be returned if the link target may be inaccessible to some users.

4 methods override LinkProviderInterface::getLink()
AuthenticationLinkProvider::getLink in examples/Plugin/jsonapi_hypermedia/LinkProvider/AuthenticationLinkProvider.php
Adds, alters or removes hyperlinks from a link collection.
EntityPublishedInterfaceLinkProvider::getLink in examples/Plugin/jsonapi_hypermedia/LinkProvider/EntityPublishedInterfaceLinkProvider.php
Adds, alters or removes hyperlinks from a link collection.
MutableResourceTypeLinkProvider::getLink in examples/Plugin/jsonapi_hypermedia/LinkProvider/MutableResourceTypeLinkProvider.php
Adds, alters or removes hyperlinks from a link collection.
TestLinkProvider::getLink in tests/modules/jsonapi_hypermedia_test_link_providers/src/Plugin/jsonapi_hypermedia/LinkProvider/TestLinkProvider.php
Adds, alters or removes hyperlinks from a link collection.

File

src/LinkProviderInterface.php, line 38

Class

LinkProviderInterface
Interface LinkProviderInterface.

Namespace

Drupal\jsonapi_hypermedia

Code

public function getLink($context);