3 namespace Drupal\Core\Path;
6 * Find an alias for a path and vice versa.
8 * @see \Drupal\Core\Path\AliasStorageInterface
10 interface AliasManagerInterface {
13 * Given the alias, return the path it represents.
15 * @param string $alias
17 * @param string $langcode
18 * An optional language code to look up the path in.
21 * The path represented by alias, or the alias if no path was found.
23 * @throws \InvalidArgumentException
24 * Thrown when the path does not start with a slash.
26 public function getPathByAlias($alias, $langcode = NULL);
29 * Given a path, return the alias.
33 * @param string $langcode
34 * An optional language code to look up the path in.
37 * An alias that represents the path, or path if no alias was found.
39 * @throws \InvalidArgumentException
40 * Thrown when the path does not start with a slash.
42 public function getAliasByPath($path, $langcode = NULL);
45 * Clear internal caches in alias manager.
48 * Source path of the alias that is being inserted/updated. Can be omitted
49 * if entire cache needs to be flushed.
51 public function cacheClear($source = NULL);