class WorkspacesAliasManager

Same name in other branches
  1. 10 core/modules/workspaces/src/WorkspacesAliasManager.php \Drupal\workspaces\WorkspacesAliasManager

Decorates the path_alias.manager service for workspace-specific caching.

@internal

Hierarchy

Expanded class hierarchy of WorkspacesAliasManager

File

core/modules/workspaces/src/WorkspacesAliasManager.php, line 14

Namespace

Drupal\workspaces
View source
class WorkspacesAliasManager implements AliasManagerInterface {
    public function __construct(AliasManagerInterface $inner, WorkspaceManagerInterface $workspaceManager) {
    }
    
    /**
     * {@inheritdoc}
     */
    public function setCacheKey($key) : void {
        if ($this->workspaceManager
            ->hasActiveWorkspace()) {
            $key = $this->workspaceManager
                ->getActiveWorkspace()
                ->id() . ':' . $key;
        }
        $this->inner
            ->setCacheKey($key);
    }
    
    /**
     * {@inheritdoc}
     */
    public function writeCache() : void {
        $this->inner
            ->writeCache();
    }
    
    /**
     * {@inheritdoc}
     */
    public function getPathByAlias($alias, $langcode = NULL) : string {
        return $this->inner
            ->getPathByAlias($alias, $langcode);
    }
    
    /**
     * {@inheritdoc}
     */
    public function getAliasByPath($path, $langcode = NULL) : string {
        return $this->inner
            ->getAliasByPath($path, $langcode);
    }
    
    /**
     * {@inheritdoc}
     */
    public function cacheClear($source = NULL) : void {
        $this->inner
            ->cacheClear($source);
    }

}

Members


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