You are here

protected static function Routes::hasNonInternalTargetResourceTypes in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/jsonapi/src/Routing/Routes.php \Drupal\jsonapi\Routing\Routes::hasNonInternalTargetResourceTypes()
  2. 10 core/modules/jsonapi/src/Routing/Routes.php \Drupal\jsonapi\Routing\Routes::hasNonInternalTargetResourceTypes()

Determines if an array of resource types has any non-internal ones.

Parameters

\Drupal\jsonapi\ResourceType\ResourceType[] $resource_types: The resource types to check.

Return value

bool TRUE if there is at least one non-internal resource type in the given array; FALSE otherwise.

1 call to Routes::hasNonInternalTargetResourceTypes()
Routes::getIndividualRoutesForResourceType in core/modules/jsonapi/src/Routing/Routes.php
Gets a route collection for the given resource type.

File

core/modules/jsonapi/src/Routing/Routes.php, line 434

Class

Routes
Defines dynamic routes.

Namespace

Drupal\jsonapi\Routing

Code

protected static function hasNonInternalTargetResourceTypes(array $resource_types) {
  return array_reduce($resource_types, function ($carry, ResourceType $target) {
    return $carry || !$target
      ->isInternal();
  }, FALSE);
}