AliasStorage deprecated
class AliasStorage implements AliasStorageInterface (View source)
deprecated
Provides a class for CRUD operations on path aliases.
All queries perform case-insensitive matching on the 'source' and 'alias' fields, so the aliases '/test-alias' and '/test-Alias' are considered to be the same, and will both refer to the same internal system path.
Constants
| TABLE |
The table for the url_alias storage. |
Properties
| protected Connection | $connection | The database connection. |
|
| protected ModuleHandlerInterface | $moduleHandler | The module handler. |
|
| protected EntityTypeManagerInterface | $entityTypeManager | The entity type manager. |
Methods
Constructs a Path CRUD object.
Saves a path alias to the database.
Fetches a specific URL alias from the database.
Deletes a URL alias.
Returns a SELECT query for the path_alias base table.
Pre-loads path alias information for a given list of source paths.
Returns an alias of Drupal system URL.
Returns Drupal system URL of an alias.
Adds path alias language fallback conditions to a select query object.
Checks if alias already exists.
Checks if there are any aliases with language defined.
Loads aliases for admin listing.
Check if any alias exists starting with $initial_substring.
Returns the path alias entity storage handler.
Details
__construct(Connection $connection, ModuleHandlerInterface $module_handler, EntityTypeManagerInterface $entity_type_manager = NULL)
Constructs a Path CRUD object.
array|false
save(string $source, string $alias, string $langcode = LanguageInterface::LANGCODE_NOT_SPECIFIED, int|null $pid = NULL)
Saves a path alias to the database.
array|false
load(array $conditions)
Fetches a specific URL alias from the database.
The default implementation performs case-insensitive matching on the 'source' and 'alias' strings.
delete(array $conditions)
Deletes a URL alias.
The default implementation performs case-insensitive matching on the 'source' and 'alias' strings.
protected SelectInterface
getBaseQuery()
Returns a SELECT query for the path_alias base table.
string[]
preloadPathAlias(array $preloaded, string $langcode)
Pre-loads path alias information for a given list of source paths.
string|false
lookupPathAlias(string $path, string $langcode)
Returns an alias of Drupal system URL.
The default implementation performs case-insensitive matching on the 'source' and 'alias' strings.
string|false
lookupPathSource($alias, string $langcode)
Returns Drupal system URL of an alias.
The default implementation performs case-insensitive matching on the 'source' and 'alias' strings.
protected
addLanguageFallback(SelectInterface $query, string $langcode)
Adds path alias language fallback conditions to a select query object.
bool
aliasExists(string $alias, string $langcode, string|null $source = NULL)
Checks if alias already exists.
The default implementation performs case-insensitive matching on the 'source' and 'alias' strings.
bool
languageAliasExists()
Checks if there are any aliases with language defined.
array
getAliasesForAdminListing(array $header, string|null $keys = NULL)
Loads aliases for admin listing.
bool
pathHasMatchingAlias(string $initial_substring)
Check if any alias exists starting with $initial_substring.
protected EntityStorageInterface
getPathAliasEntityStorage()
Returns the path alias entity storage handler.
We can not store it in the constructor because that leads to a circular dependency in the service container.