function ResourceIdentifier::isParallel

Same name in other branches
  1. 8.9.x core/modules/jsonapi/src/JsonApiResource/ResourceIdentifier.php \Drupal\jsonapi\JsonApiResource\ResourceIdentifier::isParallel()
  2. 10 core/modules/jsonapi/src/JsonApiResource/ResourceIdentifier.php \Drupal\jsonapi\JsonApiResource\ResourceIdentifier::isParallel()
  3. 11.x core/modules/jsonapi/src/JsonApiResource/ResourceIdentifier.php \Drupal\jsonapi\JsonApiResource\ResourceIdentifier::isParallel()

Determines if two ResourceIdentifiers identify the same resource object.

This method does not consider arity.

Parameters

\Drupal\jsonapi\JsonApiResource\ResourceIdentifier $a: The first ResourceIdentifier object.

\Drupal\jsonapi\JsonApiResource\ResourceIdentifier $b: The second ResourceIdentifier object.

Return value

bool TRUE if both relationships reference the same resource, even when they have differing arity values, FALSE otherwise.

1 call to ResourceIdentifier::isParallel()
ResourceIdentifier::toResourceIdentifiers in core/modules/jsonapi/src/JsonApiResource/ResourceIdentifier.php
Creates an array of ResourceIdentifier objects.

File

core/modules/jsonapi/src/JsonApiResource/ResourceIdentifier.php, line 208

Class

ResourceIdentifier
Represents a JSON:API resource identifier object.

Namespace

Drupal\jsonapi\JsonApiResource

Code

public static function isParallel(ResourceIdentifier $a, ResourceIdentifier $b) {
    return static::compare($a->withArity(0), $b->withArity(0)) === 0;
}

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