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

Breadcrumb

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

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

API Navigation

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