You are here

public static function ResourceIdentifier::isParallel in JSON:API 8.2

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 src/JsonApiResource/ResourceIdentifier.php
Creates an array of ResourceIdentifier objects.

File

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