Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. LinkCollection.php

function LinkCollection::validKey

Ensures that a link key is valid.

Parameters

string $key: A key name.

Return value

bool TRUE if the key is valid, FALSE otherwise.

2 calls to LinkCollection::validKey()
LinkCollection::withLink in core/modules/jsonapi/src/JsonApiResource/LinkCollection.php
Gets a new LinkCollection with the given link inserted.
LinkCollection::__construct in core/modules/jsonapi/src/JsonApiResource/LinkCollection.php
LinkCollection constructor.

File

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

Class

LinkCollection
Contains a set of JSON:API Link objects.

Namespace

Drupal\jsonapi\JsonApiResource

Code

protected static function validKey($key) {
    return is_string($key) && !is_numeric($key) && !str_contains($key, ':');
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal