You are here

public function AccessRestrictedLink::getInnerLink in JSON:API Hypermedia 8

Gets the bare link.

This method should not be called unless the link is accessible.

Return value

\Drupal\jsonapi\JsonApiResource\Link The JSON:API link.

File

src/AccessRestrictedLink.php, line 151

Class

AccessRestrictedLink
Decorates a JSON:API link to consider link accessibility.

Namespace

Drupal\jsonapi_hypermedia

Code

public function getInnerLink() {
  if (!$this
    ->isAllowed()) {
    throw new \LogicException('The link is not accessible.');
  }
  return $this->inner;
}