function EntityRouteHelper::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 EntityRouteHelper::getContentEntityPaths()
EntityRouteHelper::isContentEntityRoute in core/modules/navigation/src/EntityRouteHelper.php
Determines if content entity route condition is met.

File

core/modules/navigation/src/EntityRouteHelper.php, line 78

Class

EntityRouteHelper
Helper service to detect entity routes.

Namespace

Drupal\navigation

Code

protected function getContentEntityPaths() : array {
    if (isset($this->contentEntityPaths)) {
        return $this->contentEntityPaths;
    }
    $content_entity_paths = $this->cacheBackend
        ->get(static::ENTITY_ROUTE_CID);
    if (isset($content_entity_paths->data)) {
        $this->contentEntityPaths = $content_entity_paths->data;
        return $this->contentEntityPaths;
    }
    $this->contentEntityPaths = $this->doGetContentEntityPaths();
    $this->cacheBackend
        ->set(static::ENTITY_ROUTE_CID, $this->contentEntityPaths, CacheBackendInterface::CACHE_PERMANENT, [
        'entity_types',
        'routes',
    ]);
    return $this->contentEntityPaths;
}

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