Version 1
[yaffs-website] / web / core / lib / Drupal / Core / Path / AliasManagerInterface.php
1 <?php
2
3 namespace Drupal\Core\Path;
4
5 /**
6  * Find an alias for a path and vice versa.
7  *
8  * @see \Drupal\Core\Path\AliasStorageInterface
9  */
10 interface AliasManagerInterface {
11
12   /**
13    * Given the alias, return the path it represents.
14    *
15    * @param string $alias
16    *   An alias.
17    * @param string $langcode
18    *   An optional language code to look up the path in.
19    *
20    * @return string
21    *   The path represented by alias, or the alias if no path was found.
22    *
23    * @throws \InvalidArgumentException
24    *   Thrown when the path does not start with a slash.
25    */
26   public function getPathByAlias($alias, $langcode = NULL);
27
28   /**
29    * Given a path, return the alias.
30    *
31    * @param string $path
32    *   A path.
33    * @param string $langcode
34    *   An optional language code to look up the path in.
35    *
36    * @return string
37    *   An alias that represents the path, or path if no alias was found.
38    *
39    * @throws \InvalidArgumentException
40    *   Thrown when the path does not start with a slash.
41    */
42   public function getAliasByPath($path, $langcode = NULL);
43
44   /**
45    * Clear internal caches in alias manager.
46    *
47    * @param $source
48    *   Source path of the alias that is being inserted/updated. Can be omitted
49    *   if entire cache needs to be flushed.
50    */
51   public function cacheClear($source = NULL);
52
53 }