AliasManagerInterface.php 1.58 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
<?php

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

namespace Drupal\Core\Path;

interface AliasManagerInterface {

  /**
   * Given a path alias, return the internal path it represents.
   *
   * @param $path
   *   A Drupal path alias.
   * @param $path_language
   *   An optional language code to look up the path in.
   *
   * @return
   *   The internal path represented by the alias, or the original alias if no
   *   internal path was found.
   */
  public function getSystemPath($path, $path_language = NULL);

  /**
   * Given an internal Drupal path, return the alias set by the administrator.
   *
   * @param $path
   *   An internal Drupal path.
   *
   * @param $path_language
   *   An optional language code to look up the path in.
   *
   * @return
   *   An aliased path if one was found, or the original path if no alias was
   *   found.
   */
  public function getPathAlias($path, $path_language = NULL);

  /**
   * Returns an array of system paths that have been looked up.
   *
   * @return array
   *   An array of all system paths that have been looked up during the current
   *   request.
   */
  public function getPathLookups();

  /**
   * Preload a set of paths for bulk alias lookups.
   *
   * @param $path_list
   *   An array of system paths.
   */
  public function preloadPathLookups(array $path_list);
57 58 59 60 61 62 63 64 65

  /**
   * 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);
66
}