function LinkCollection::hasLinkWithKey

Same name in other branches
  1. 9 core/modules/jsonapi/src/JsonApiResource/LinkCollection.php \Drupal\jsonapi\JsonApiResource\LinkCollection::hasLinkWithKey()
  2. 8.9.x core/modules/jsonapi/src/JsonApiResource/LinkCollection.php \Drupal\jsonapi\JsonApiResource\LinkCollection::hasLinkWithKey()
  3. 11.x 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 109

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);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.