protected static function IncludeResolver::resolveInternalIncludePaths in Drupal 10
Same name and namespace in other branches
- 8 core/modules/jsonapi/src/IncludeResolver.php \Drupal\jsonapi\IncludeResolver::resolveInternalIncludePaths()
- 9 core/modules/jsonapi/src/IncludeResolver.php \Drupal\jsonapi\IncludeResolver::resolveInternalIncludePaths()
Resolves an array of public field paths.
Parameters
\Drupal\jsonapi\ResourceType\ResourceType $base_resource_type: The base resource type from which to resolve an internal include path.
array $paths: An array of exploded include paths.
Return value
array An array of all possible internal include paths derived from the given public include paths.
See also
self::buildTree
File
- core/
modules/ jsonapi/ src/ IncludeResolver.php, line 209
Class
- IncludeResolver
- Resolves included resources for an entity or collection of entities.
Namespace
Drupal\jsonapiCode
protected static function resolveInternalIncludePaths(ResourceType $base_resource_type, array $paths) {
$internal_paths = array_map(function ($exploded_path) use ($base_resource_type) {
if (empty($exploded_path)) {
return [];
}
return FieldResolver::resolveInternalIncludePath($base_resource_type, $exploded_path);
}, $paths);
$flattened_paths = array_reduce($internal_paths, 'array_merge', []);
return $flattened_paths;
}