You are here

public static function ResourceIdentifier::isParallel in Drupal 8

Same name and namespace in other branches
  1. 9 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()

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