You are here

public function LinkCollection::hasLinkWithKey in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/jsonapi/src/JsonApiResource/LinkCollection.php \Drupal\jsonapi\JsonApiResource\LinkCollection::hasLinkWithKey()

Whether a link with the given key exists.

Parameters

string $key: The key.

Return value

bool TRUE if a link with the given key exist, FALSE otherwise.

File

core/modules/jsonapi/src/JsonApiResource/LinkCollection.php, line 108

Class

LinkCollection
Contains a set of JSON:API Link objects.

Namespace

Drupal\jsonapi\JsonApiResource

Code

public function hasLinkWithKey($key) {
  return array_key_exists($key, $this->links);
}