function EntityRouteHelper::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 EntityRouteHelper::getContentEntityTypePaths()
- EntityRouteHelper::doGetContentEntityPaths in core/
modules/ navigation/ src/ EntityRouteHelper.php
File
-
core/
modules/ navigation/ src/ EntityRouteHelper.php, line 118
Class
- EntityRouteHelper
- Helper service to detect entity routes.
Namespace
Drupal\navigationCode
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.