function FieldResolver::isDelta

Same name in other branches
  1. 9 core/modules/jsonapi/src/Context/FieldResolver.php \Drupal\jsonapi\Context\FieldResolver::isDelta()
  2. 8.9.x core/modules/jsonapi/src/Context/FieldResolver.php \Drupal\jsonapi\Context\FieldResolver::isDelta()
  3. 11.x core/modules/jsonapi/src/Context/FieldResolver.php \Drupal\jsonapi\Context\FieldResolver::isDelta()

Determines if a path part targets a specific field delta.

Parameters

string $part: The path part.

Return value

bool TRUE if the part is an integer, FALSE otherwise.

1 call to FieldResolver::isDelta()
FieldResolver::resolveInternalEntityQueryPath in core/modules/jsonapi/src/Context/FieldResolver.php
Resolves external field expressions into entity query compatible paths.

File

core/modules/jsonapi/src/Context/FieldResolver.php, line 667

Class

FieldResolver
A service that evaluates external path expressions against Drupal fields.

Namespace

Drupal\jsonapi\Context

Code

protected static function isDelta($part) {
    return (bool) preg_match('/^[0-9]+$/', $part);
}

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