function EntityReferenceFieldNormalizer::hasNonInternalResourceType

Same name in other branches
  1. 9 core/modules/jsonapi/src/Normalizer/EntityReferenceFieldNormalizer.php \Drupal\jsonapi\Normalizer\EntityReferenceFieldNormalizer::hasNonInternalResourceType()
  2. 10 core/modules/jsonapi/src/Normalizer/EntityReferenceFieldNormalizer.php \Drupal\jsonapi\Normalizer\EntityReferenceFieldNormalizer::hasNonInternalResourceType()
  3. 11.x core/modules/jsonapi/src/Normalizer/EntityReferenceFieldNormalizer.php \Drupal\jsonapi\Normalizer\EntityReferenceFieldNormalizer::hasNonInternalResourceType()

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 EntityReferenceFieldNormalizer::hasNonInternalResourceType()
EntityReferenceFieldNormalizer::getRelationshipLinks in core/modules/jsonapi/src/Normalizer/EntityReferenceFieldNormalizer.php
Gets the links for the relationship.

File

core/modules/jsonapi/src/Normalizer/EntityReferenceFieldNormalizer.php, line 109

Class

EntityReferenceFieldNormalizer
Normalizer class specific for entity reference field objects.

Namespace

Drupal\jsonapi\Normalizer

Code

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

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.