You are here

protected static function RelationshipNormalizerValue::hasNonInternalResourceType in JSON:API 8

Determines if a given list of resource types contains a non-internal type.

Parameters

\Drupal\jsonapi\ResourceType\ResourceType[] $resource_types: The JSON API resource types to evaluate.

Return value

bool FALSE if every resource type is internal, TRUE otherwise.

1 call to RelationshipNormalizerValue::hasNonInternalResourceType()
RelationshipNormalizerValue::getLinks in src/Normalizer/Value/RelationshipNormalizerValue.php
Gets the links for the relationship.

File

src/Normalizer/Value/RelationshipNormalizerValue.php, line 182

Class

RelationshipNormalizerValue
Helps normalize relationships in compliance with the JSON API spec.

Namespace

Drupal\jsonapi\Normalizer\Value

Code

protected static function hasNonInternalResourceType(array $resource_types) {
  foreach ($resource_types as $resource_type) {
    if (!$resource_type
      ->isInternal()) {
      return TRUE;
    }
  }
  return FALSE;
}