function NavigationRenderer::getContentEntityPaths

Returns the paths for the link templates of all content entities.

Return value

array An array of all content entity type IDs, keyed by the corresponding link template paths.

1 call to NavigationRenderer::getContentEntityPaths()
NavigationRenderer::meetsContentEntityRoutesCondition in core/modules/navigation/src/NavigationRenderer.php
Determines if content entity route condition is met.

File

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

Class

NavigationRenderer
Handle rendering for different pieces of the navigation.

Namespace

Drupal\navigation

Code

protected function getContentEntityPaths() : array {
  if (isset($this->contentEntityPaths)) {
    return $this->contentEntityPaths;
  }
  $this->contentEntityPaths = [];
  $entity_types = $this->entityTypeManager
    ->getDefinitions();
  foreach ($entity_types as $entity_type) {
    if ($entity_type->entityClassImplements(ContentEntityInterface::class)) {
      $entity_paths = $this->getContentEntityTypePaths($entity_type);
      $this->contentEntityPaths = array_merge($this->contentEntityPaths, $entity_paths);
    }
  }
  return $this->contentEntityPaths;
}

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