interface AliasManagerInterface

Same name in other branches
  1. 8.9.x core/modules/path_alias/src/AliasManagerInterface.php \Drupal\path_alias\AliasManagerInterface
  2. 8.9.x core/lib/Drupal/Core/Path/AliasManagerInterface.php \Drupal\Core\Path\AliasManagerInterface
  3. 10 core/modules/path_alias/src/AliasManagerInterface.php \Drupal\path_alias\AliasManagerInterface
  4. 11.x core/modules/path_alias/src/AliasManagerInterface.php \Drupal\path_alias\AliasManagerInterface

Find an alias for a path and vice versa.

Hierarchy

Expanded class hierarchy of AliasManagerInterface

All classes that implement AliasManagerInterface

See also

\Drupal\path_alias\AliasStorageInterface

11 files declare their use of AliasManagerInterface
AliasPathProcessor.php in core/modules/path_alias/src/PathProcessor/AliasPathProcessor.php
MockAliasManager.php in core/modules/system/src/Tests/Routing/MockAliasManager.php
PathAliasListBuilder.php in core/modules/path/src/PathAliasListBuilder.php
PathAliasSubscriber.php in core/modules/path_alias/src/EventSubscriber/PathAliasSubscriber.php
PathHooksTest.php in core/modules/path_alias/tests/src/Kernel/PathHooksTest.php

... See full list

File

core/modules/path_alias/src/AliasManagerInterface.php, line 10

Namespace

Drupal\path_alias
View source
interface AliasManagerInterface {
    
    /**
     * Given the alias, return the path it represents.
     *
     * @param string $alias
     *   An alias.
     * @param string $langcode
     *   An optional language code to look up the path in.
     *
     * @return string
     *   The path represented by alias, or the alias if no path was found.
     *
     * @throws \InvalidArgumentException
     *   Thrown when the path does not start with a slash.
     */
    public function getPathByAlias($alias, $langcode = NULL);
    
    /**
     * Given a path, return the alias.
     *
     * @param string $path
     *   A path.
     * @param string $langcode
     *   An optional language code to look up the path in.
     *
     * @return string
     *   An alias that represents the path, or path if no alias was found.
     *
     * @throws \InvalidArgumentException
     *   Thrown when the path does not start with a slash.
     */
    public function getAliasByPath($path, $langcode = NULL);
    
    /**
     * Clears the static caches in alias manager and rebuilds the whitelist.
     *
     * @param $source
     *   Source path of the alias that is being inserted/updated. If omitted, the
     *   entire lookup static cache will be cleared and the whitelist will be
     *   rebuilt.
     */
    public function cacheClear($source = NULL);

}

Members

Title Sort descending Modifiers Object type Summary Overrides
AliasManagerInterface::cacheClear public function Clears the static caches in alias manager and rebuilds the whitelist. 2
AliasManagerInterface::getAliasByPath public function Given a path, return the alias. 2
AliasManagerInterface::getPathByAlias public function Given the alias, return the path it represents. 2

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