AliasManagerInterface.php 1.07 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12
<?php

/**
 * @file
 * Contains Drupal\Core\Path\AliasManagerInterface.
 */

namespace Drupal\Core\Path;

interface AliasManagerInterface {

  /**
13
   * Given the alias, return the path it represents.
14
   *
15 16 17
   * @param string $alias
   *   An alias.
   * @param string $langcode
18 19
   *   An optional language code to look up the path in.
   *
20 21
   * @return string
   *   The path represented by alias, or the alias if no path was found.
22
   */
23
  public function getPathByAlias($alias, $langcode = NULL);
24 25

  /**
26
   * Given a path, return the alias.
27
   *
28 29 30
   * @param string $path
   *   A path.
   * @param string $langcode
31 32
   *   An optional language code to look up the path in.
   *
33 34
   * @return string
   *   An alias that represents the path, or path if no alias was found.
35
   */
36
  public function getAliasByPath($path, $langcode = NULL);
37

38 39 40 41 42 43 44 45
  /**
   * Clear internal caches in alias manager.
   *
   * @param $source
   *   Source path of the alias that is being inserted/updated. Can be ommitted
   *   if entire cache needs to be flushed.
   */
  public function cacheClear($source = NULL);
46
}