Drupal 8  8.0.2
AliasManager Class Reference
Inheritance diagram for AliasManager:

Public Member Functions

 __construct (AliasStorageInterface $storage, AliasWhitelistInterface $whitelist, LanguageManagerInterface $language_manager, CacheBackendInterface $cache)
 
 setCacheKey ($key)
 
 writeCache ()
 
 getPathByAlias ($alias, $langcode=NULL)
 
 getAliasByPath ($path, $langcode=NULL)
 
 cacheClear ($source=NULL)
 

Protected Member Functions

 pathAliasWhitelistRebuild ($path=NULL)
 
 getRequestTime ()
 

Protected Attributes

 $storage
 
 $cache
 
 $cacheKey
 
 $cacheNeedsWriting = FALSE
 
 $languageManager
 
 $lookupMap = array()
 
 $noPath = array()
 
 $whitelist
 
 $noAlias = array()
 
 $langcodePreloaded = array()
 
 $preloadedPathLookups = FALSE
 

Detailed Description

The default alias manager implementation.

Constructor & Destructor Documentation

__construct ( AliasStorageInterface  $storage,
AliasWhitelistInterface  $whitelist,
LanguageManagerInterface  $language_manager,
CacheBackendInterface  $cache 
)

Constructs an AliasManager.

Parameters
\Drupal\Core\Path\AliasStorageInterface$storageThe alias storage service.
\Drupal\Core\Path\AliasWhitelistInterface$whitelistThe whitelist implementation to use.
\Drupal\Core\Language\LanguageManagerInterface$language_managerThe language manager.
\Drupal\Core\Cache\CacheBackendInterface$cacheCache backend.

References Drupal\cache(), and Drupal\languageManager().

Here is the call graph for this function:

Member Function Documentation

cacheClear (   $source = NULL)

{Clear internal caches in alias manager.

Parameters
$sourceSource path of the alias that is being inserted/updated. Can be omitted if entire cache needs to be flushed.
}

Implements AliasManagerInterface.

References Drupal\cache(), and AliasManager\pathAliasWhitelistRebuild().

Here is the call graph for this function:

getAliasByPath (   $path,
  $langcode = NULL 
)

{Given a path, return the alias.

Parameters
string$pathA path.
string$langcodeAn optional language code to look up the path in.
Returns
string An alias that represents the path, or path if no alias was found.
Exceptions
\InvalidArgumentExceptionThrown when the path does not start with a slash.
}

Implements AliasManagerInterface.

References Drupal\cache(), Drupal\languageManager(), and LanguageInterface\TYPE_URL.

Here is the call graph for this function:

getPathByAlias (   $alias,
  $langcode = NULL 
)

{Given the alias, return the path it represents.

Parameters
string$aliasAn alias.
string$langcodeAn optional language code to look up the path in.
Returns
string The path represented by alias, or the alias if no path was found.
Exceptions
\InvalidArgumentExceptionThrown when the path does not start with a slash.
}

Implements AliasManagerInterface.

References Drupal\languageManager(), and LanguageInterface\TYPE_URL.

Here is the call graph for this function:

getRequestTime ( )
protected

Wrapper method for REQUEST_TIME constant.

Returns
int

Referenced by AliasManager\writeCache().

Here is the caller graph for this function:

pathAliasWhitelistRebuild (   $path = NULL)
protected

Rebuild the path alias white list.

Parameters
string$pathAn optional path for which an alias is being inserted.
Returns
An array containing a white list of path aliases.

Referenced by AliasManager\cacheClear().

Here is the caller graph for this function:

setCacheKey (   $key)

{Specify the key to use when writing the cache.}

Implements CacheDecoratorInterface.

writeCache ( )

{Write the cache.}

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.

Implements CacheDecoratorInterface.

References Drupal\cache(), and AliasManager\getRequestTime().

Here is the call graph for this function:


The documentation for this class was generated from the following file: