AliasManagerInterface

Find an alias for a path and vice versa. Hierarchy interface \Drupal\Core\Path\AliasManagerInterface See also \Drupal\Core\Path\AliasStorageInterface File core/lib/Drupal/Core/Path/AliasManagerInterface.php, line 10 Namespace Drupal\Core\Path Members Name Modifiers Type Description AliasManagerInterface::cacheClear public function Clear internal caches in alias manager. AliasManagerInterface::getAliasByPath public function Given a path, return the alias. Alias

AliasManager::__construct

public AliasManager::__construct(AliasStorageInterface $storage, AliasWhitelistInterface $whitelist, LanguageManagerInterface $language_manager, CacheBackendInterface $cache) Constructs an AliasManager. Parameters \Drupal\Core\Path\AliasStorageInterface $storage: The alias storage service. \Drupal\Core\Path\AliasWhitelistInterface $whitelist: The whitelist implementation to use. \Drupal\Core\Language\LanguageManagerInterface $language_manager: The language manager. \Drupal\Core\Cache\CacheBack

AliasManager::writeCache

public AliasManager::writeCache() Cache an array of the paths available on each page. We assume that aliases will be needed for the majority of these paths during subsequent requests, and load them in a single query during path alias lookup. Overrides CacheDecoratorInterface::writeCache File core/lib/Drupal/Core/Path/AliasManager.php, line 129 Class AliasManager The default alias manager implementation. Namespace Drupal\Core\Path Code public function writeCache() { // Check if the p

AliasManager::setCacheKey

public AliasManager::setCacheKey($key) Specify the key to use when writing the cache. Overrides CacheDecoratorInterface::setCacheKey File core/lib/Drupal/Core/Path/AliasManager.php, line 117 Class AliasManager The default alias manager implementation. Namespace Drupal\Core\Path Code public function setCacheKey($key) { // Prefix the cache key to avoid clashes with other caches. $this->cacheKey = 'preload-paths:' . $key; }

AliasManager::pathAliasWhitelistRebuild

protected AliasManager::pathAliasWhitelistRebuild($path = NULL) Rebuild the path alias white list. Parameters string $path: An optional path for which an alias is being inserted. Return value An array containing a white list of path aliases. File core/lib/Drupal/Core/Path/AliasManager.php, line 280 Class AliasManager The default alias manager implementation. Namespace Drupal\Core\Path Code protected function pathAliasWhitelistRebuild($path = NULL) { // When paths are inserted, only

AliasManager::getRequestTime

protected AliasManager::getRequestTime() Wrapper method for REQUEST_TIME constant. Return value int File core/lib/Drupal/Core/Path/AliasManager.php, line 296 Class AliasManager The default alias manager implementation. Namespace Drupal\Core\Path Code protected function getRequestTime() { return defined('REQUEST_TIME') ? REQUEST_TIME : (int) $_SERVER['REQUEST_TIME']; }

AliasManager::getPathByAlias

public AliasManager::getPathByAlias($alias, $langcode = NULL) Given the alias, return the path it represents. Parameters string $alias: An alias. string $langcode: An optional language code to look up the path in. Return value 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. Overrides AliasManagerInterface::getPathByAlias File core/lib/Drupal/Core/Path/AliasManager.php, line 151 Clas

AliasManager::getAliasByPath

public AliasManager::getAliasByPath($path, $langcode = NULL) Given a path, return the alias. Parameters string $path: A path. string $langcode: An optional language code to look up the path in. Return value 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. Overrides AliasManagerInterface::getAliasByPath File core/lib/Drupal/Core/Path/AliasManager.php, line 184 Class AliasManager The

AliasManager::cacheClear

public AliasManager::cacheClear($source = NULL) Clear internal caches in alias manager. Parameters $source: Source path of the alias that is being inserted/updated. Can be omitted if entire cache needs to be flushed. Overrides AliasManagerInterface::cacheClear File core/lib/Drupal/Core/Path/AliasManager.php, line 254 Class AliasManager The default alias manager implementation. Namespace Drupal\Core\Path Code public function cacheClear($source = NULL) { if ($source) { foreach (ar

AliasManager::$whitelist

Holds the array of whitelisted path aliases. Type: \Drupal\Core\Path\AliasWhitelistInterface File core/lib/Drupal/Core/Path/AliasManager.php, line 69 Class AliasManager The default alias manager implementation. Namespace Drupal\Core\Path Code protected $whitelist;