public static function Routes::hasNonInternalTargetResourceTypes in JSON:API Schema 8
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.
2 calls to Routes::hasNonInternalTargetResourceTypes()
- JsonApiSchemaController::addRelationshipsSchemaLinks in src/
Controller/ JsonApiSchemaController.php - Routes::routes in src/
Routing/ Routes.php
File
- src/
Routing/ Routes.php, line 124
Class
Namespace
Drupal\jsonapi_schema\RoutingCode
public static function hasNonInternalTargetResourceTypes(array $resource_types) {
return array_reduce($resource_types, function ($carry, ResourceType $target) {
return $carry || !$target
->isInternal();
}, FALSE);
}