function NavigationRenderer::getContentEntityTypePaths

Returns the path for the link template for a given content entity type.

Parameters

\Drupal\Core\Entity\EntityTypeInterface $entity_type: The entity type definition.

Return value

array Array containing the paths for the given content entity type.

1 call to NavigationRenderer::getContentEntityTypePaths()
NavigationRenderer::getContentEntityPaths in core/modules/navigation/src/NavigationRenderer.php
Returns the paths for the link templates of all content entities.

File

core/modules/navigation/src/NavigationRenderer.php, line 335

Class

NavigationRenderer
Handle rendering for different pieces of the navigation.

Namespace

Drupal\navigation

Code

protected function getContentEntityTypePaths(EntityTypeInterface $entity_type) : array {
    $paths = array_filter($entity_type->getLinkTemplates(), fn($template) => $template !== 'collection', ARRAY_FILTER_USE_KEY);
    if ($this->isLayoutBuilderEntityType($entity_type)) {
        $paths[] = $entity_type->getLinkTemplate('canonical') . '/layout';
    }
    return array_fill_keys($paths, $entity_type->id());
}

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