public function MenuItemsResource::getRouteResourceTypes in JSON:API Menu Items 1.2.x
Same name and namespace in other branches
- 1.0.x src/Resource/MenuItemsResource.php \Drupal\jsonapi_menu_items\Resource\MenuItemsResource::getRouteResourceTypes()
- 1.1.x src/Resource/MenuItemsResource.php \Drupal\jsonapi_menu_items\Resource\MenuItemsResource::getRouteResourceTypes()
File
- src/
Resource/ MenuItemsResource.php, line 86
Class
- MenuItemsResource
- Processes a request for a collection of featured nodes.
Namespace
Drupal\jsonapi_menu_items\ResourceCode
public function getRouteResourceTypes(Route $route, string $route_name) : array {
$resource_types = [];
foreach ([
'menu_link_config',
'menu_link_content',
] as $type) {
$resource_type = $this->resourceTypeRepository
->get($type, $type);
if ($resource_type) {
$resource_types[] = $resource_type;
}
}
return $resource_types;
}