You are here

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

Determines if an array of ResourceIdentifier objects is duplicate free.

Parameters

\Drupal\jsonapi\JsonApiResource\ResourceIdentifier[] $resource_identifiers: The list of ResourceIdentifiers to assess.

Return value

bool Whether all the given resource identifiers are unique.

1 call to ResourceIdentifier::areResourceIdentifiersUnique()
ResourceIdentifierNormalizer::denormalize in src/Normalizer/ResourceIdentifierNormalizer.php
Denormalizes data back into an object of the given class.

File

src/JsonApiResource/ResourceIdentifier.php, line 267

Class

ResourceIdentifier
Represents a JSON:API resource identifier object.

Namespace

Drupal\jsonapi\JsonApiResource

Code

public static function areResourceIdentifiersUnique(array $resource_identifiers) {
  return count($resource_identifiers) === count(static::deduplicate($resource_identifiers));
}