Exponential 5.x Kernel 7.5.40 Exponential New Stack (Symfony-based) Kernel — PHP Class Reference

Public Member Functions | List of all members
eZ\Publish\SPI\Persistence\Content\UrlAlias\Handler Interface Reference

The UrlAlias Handler interface provides nice urls management. More...

Inheritance diagram for eZ\Publish\SPI\Persistence\Content\UrlAlias\Handler:

## Public Member Functions
| publishUrlAliasForLocation ($locationId, $parentLocationId, $name, $languageCode, $alwaysAvailable=false)
| This method creates or updates an urlalias from a new or changed content name in a language (if published). More...
| createCustomUrlAlias ($locationId, $path, $forwarding=false, $languageCode=null, $alwaysAvailable=false)
| Create a user chosen $alias pointing to $locationId in $languageCode. More...
| createGlobalUrlAlias ($resource, $path, $forwarding=false, $languageCode=null, $alwaysAvailable=false)
| Create a user chosen $alias pointing to a resource in $languageCode. More...
| listGlobalURLAliases ($languageCode=null, $offset=0, $limit=-1)
| List global aliases. More...
| listURLAliasesForLocation ($locationId, $custom=false)
| List of url entries of $urlType, pointing to $locationId. More...
| removeURLAliases (array $urlAliases)
| Removes url aliases. More...
| lookup ($url)
| Looks up a url alias for the given url. More...
| loadUrlAlias ($id)
| Loads URL alias by given $id. More...
| locationMoved ($locationId, $oldParentId, $newParentId)
| Notifies the underlying engine that a location has moved. More...
| locationCopied ($locationId, $newLocationId, $newParentId)
| Notifies the underlying engine that a location was copied. More...
| locationSwapped ($location1Id, $location1ParentId, $location2Id, $location2ParentId)
| Notifies the underlying engine that a location was swapped. More...
| locationDeleted ($locationId)
| Notifies the underlying engine that a location was deleted or moved to trash. More...
| translationRemoved (array $locationIds, $languageCode)
| Notifies the underlying engine that Locations Content Translation was removed. More...
| archiveUrlAliasesForDeletedTranslations ($locationId, $parentLocationId, array $languageCodes)
| Archive UrlAliases for Translations that were removed from the underlying published content. More...
| deleteCorruptedUrlAliases ()
| Delete corrupted URL aliases (global, custom and system). More...
| repairBrokenUrlAliasesForLocation (int $locationId)
| Attempt repairing auto-generated URL aliases for the given Location (including history). More...

## Detailed Description

The UrlAlias Handler interface provides nice urls management.

Its methods operate on a representation of the url alias data structure held inside a storage engine.

Definition at line 15 of file SPI/Persistence/Content/UrlAlias/Handler.php.

## Member Function Documentation

## ◆ archiveUrlAliasesForDeletedTranslations()

eZ\Publish\SPI\Persistence\Content\UrlAlias\Handler::archiveUrlAliasesForDeletedTranslations | ( |  | $locationId,
|  |  | $parentLocationId,
|  | array | $languageCodes
| ) |  |

Archive UrlAliases for Translations that were removed from the underlying published content.

Parameters

  int | $locationId | Location of underlying published Content Object
  int | $parentLocationId |
  array | $languageCodes | Language codes of currently published Content Object Translations

Implemented in eZ\Publish\Core\Persistence\Legacy\Content\UrlAlias\Handler, and eZ\Publish\Core\Persistence\Cache\UrlAliasHandler.

## ◆ createCustomUrlAlias()

eZ\Publish\SPI\Persistence\Content\UrlAlias\Handler::createCustomUrlAlias | ( |  | $locationId,
|  |  | $path,
|  |  | $forwarding = `false`,
|  |  | $languageCode = `null`,
|  |  | $alwaysAvailable = `false`
| ) |  |

Create a user chosen $alias pointing to $locationId in $languageCode.

If $languageCode is null the $alias is created in the system's default language. $alwaysAvailable makes the alias available in all languages.

Parameters

  mixed | $locationId |
  string | $path |
  bool | $forwarding |
  string | null | $languageCode |
  bool | $alwaysAvailable |

Returns
  \eZ\Publish\SPI\Persistence\Content\UrlAlias

Implemented in eZ\Publish\Core\Persistence\Legacy\Content\UrlAlias\Handler, and eZ\Publish\Core\Persistence\Cache\UrlAliasHandler.

## ◆ createGlobalUrlAlias()

eZ\Publish\SPI\Persistence\Content\UrlAlias\Handler::createGlobalUrlAlias | ( |  | $resource,
|  |  | $path,
|  |  | $forwarding = `false`,
|  |  | $languageCode = `null`,
|  |  | $alwaysAvailable = `false`
| ) |  |

Create a user chosen $alias pointing to a resource in $languageCode.

This method does not handle location resources - if a user enters a location target the createCustomUrlAlias method has to be used.

If $languageCode is null the $alias is created in the system's default language. $alwaysAvailable makes the alias available in all languages.

Parameters

  string | $resource |
  string | $path |
  bool | $forwarding |
  string | null | $languageCode |
  bool | $alwaysAvailable |

Returns
  \eZ\Publish\SPI\Persistence\Content\UrlAlias

Implemented in eZ\Publish\Core\Persistence\Legacy\Content\UrlAlias\Handler, and eZ\Publish\Core\Persistence\Cache\UrlAliasHandler.

## ◆ deleteCorruptedUrlAliases()

eZ\Publish\SPI\Persistence\Content\UrlAlias\Handler::deleteCorruptedUrlAliases | ( |  | ) |

Delete corrupted URL aliases (global, custom and system).

Returns
  int Number of deleted URL aliases

Implemented in eZ\Publish\Core\Persistence\Legacy\Content\UrlAlias\Handler, and eZ\Publish\Core\Persistence\Cache\UrlAliasHandler.

## ◆ listGlobalURLAliases()

eZ\Publish\SPI\Persistence\Content\UrlAlias\Handler::listGlobalURLAliases | ( |  | $languageCode = `null`,
|  |  | $offset = `0`,
|  |  | $limit = `-1`
| ) |  |

List global aliases.

Exceptions

Implemented in eZ\Publish\Core\Persistence\Legacy\Content\UrlAlias\Handler, and eZ\Publish\Core\Persistence\Cache\UrlAliasHandler.

## ◆ listURLAliasesForLocation()

eZ\Publish\SPI\Persistence\Content\UrlAlias\Handler::listURLAliasesForLocation | ( |  | $locationId,
|  |  | $custom = `false`
| ) |  |

List of url entries of $urlType, pointing to $locationId.

Exceptions

Implemented in eZ\Publish\Core\Persistence\Legacy\Content\UrlAlias\Handler, and eZ\Publish\Core\Persistence\Cache\UrlAliasHandler.

## ◆ loadUrlAlias()

eZ\Publish\SPI\Persistence\Content\UrlAlias\Handler::loadUrlAlias | ( |  | $id | ) |

Loads URL alias by given $id.

Exceptions

Implemented in eZ\Publish\Core\Persistence\Legacy\Content\UrlAlias\Handler, and eZ\Publish\Core\Persistence\Cache\UrlAliasHandler.

## ◆ locationCopied()

eZ\Publish\SPI\Persistence\Content\UrlAlias\Handler::locationCopied | ( |  | $locationId,
|  |  | $newLocationId,
|  |  | $newParentId
| ) |  |

Notifies the underlying engine that a location was copied.

This method triggers the creation of the autogenerated aliases for the copied locations

Parameters

  mixed | $locationId |
  mixed | $newLocationId |
  mixed | $newParentId |

Implemented in eZ\Publish\Core\Persistence\Legacy\Content\UrlAlias\Handler, and eZ\Publish\Core\Persistence\Cache\UrlAliasHandler.

## ◆ locationDeleted()

eZ\Publish\SPI\Persistence\Content\UrlAlias\Handler::locationDeleted | ( |  | $locationId | ) |

Notifies the underlying engine that a location was deleted or moved to trash.

Parameters

  mixed | $locationId |

Returns
  array

Implemented in eZ\Publish\Core\Persistence\Legacy\Content\UrlAlias\Handler, and eZ\Publish\Core\Persistence\Cache\UrlAliasHandler.

## ◆ locationMoved()

eZ\Publish\SPI\Persistence\Content\UrlAlias\Handler::locationMoved | ( |  | $locationId,
|  |  | $oldParentId,
|  |  | $newParentId
| ) |  |

Notifies the underlying engine that a location has moved.

This method triggers the change of the autogenerated aliases

Parameters

  mixed | $locationId |
  mixed | $oldParentId |
  mixed | $newParentId |

Implemented in eZ\Publish\Core\Persistence\Legacy\Content\UrlAlias\Handler, and eZ\Publish\Core\Persistence\Cache\UrlAliasHandler.

## ◆ locationSwapped()

eZ\Publish\SPI\Persistence\Content\UrlAlias\Handler::locationSwapped | ( |  | $location1Id,
|  |  | $location1ParentId,
|  |  | $location2Id,
|  |  | $location2ParentId
| ) |  |

Notifies the underlying engine that a location was swapped.

This method triggers the change of the autogenerated aliases.

Parameters

  string | int | $location1Id |
  string | int | $location1ParentId |
  string | int | $location2Id |
  string | int | $location2ParentId |

Implemented in eZ\Publish\Core\Persistence\Legacy\Content\UrlAlias\Handler, and eZ\Publish\Core\Persistence\Cache\UrlAliasHandler.

## ◆ lookup()

eZ\Publish\SPI\Persistence\Content\UrlAlias\Handler::lookup | ( |  | $url | ) |

Looks up a url alias for the given url.

Exceptions

Implemented in eZ\Publish\Core\Persistence\Legacy\Content\UrlAlias\Handler, and eZ\Publish\Core\Persistence\Cache\UrlAliasHandler.

## ◆ publishUrlAliasForLocation()

eZ\Publish\SPI\Persistence\Content\UrlAlias\Handler::publishUrlAliasForLocation | ( |  | $locationId,
|  |  | $parentLocationId,
|  |  | $name,
|  |  | $languageCode,
|  |  | $alwaysAvailable = `false`
| ) |  |

This method creates or updates an urlalias from a new or changed content name in a language (if published).

It also can be used to create an alias for a new location of content. On update the old alias is linked to the new one (i.e. a history alias is generated).

$alwaysAvailable controls whether the url alias is accessible in all languages.

Parameters

  mixed | $locationId |
  mixed | $parentLocationId |
  string | $name | the new name computed by the name schema or url alias schema
  string | $languageCode |
  bool | $alwaysAvailable |

## ◆ removeURLAliases()

eZ\Publish\SPI\Persistence\Content\UrlAlias\Handler::removeURLAliases | ( | array | $urlAliases | ) |

Removes url aliases.

Autogenerated aliases are not removed by this method.

Parameters

  \eZ\Publish\SPI\Persistence\Content\UrlAlias[] | $urlAliases |

Returns
  bool

Implemented in eZ\Publish\Core\Persistence\Legacy\Content\UrlAlias\Handler, and eZ\Publish\Core\Persistence\Cache\UrlAliasHandler.

## ◆ repairBrokenUrlAliasesForLocation()

eZ\Publish\SPI\Persistence\Content\UrlAlias\Handler::repairBrokenUrlAliasesForLocation | ( | int | $locationId | ) |

Attempt repairing auto-generated URL aliases for the given Location (including history).

Note: it is assumed that at this point original, working, URL Alias for Location is published.

Parameters

  int | $locationId |

Exceptions

Implemented in eZ\Publish\Core\Persistence\Legacy\Content\UrlAlias\Handler, and eZ\Publish\Core\Persistence\Cache\UrlAliasHandler.

## ◆ translationRemoved()

eZ\Publish\SPI\Persistence\Content\UrlAlias\Handler::translationRemoved | ( | array | $locationIds,
|  |  | $languageCode
| ) |  |

Notifies the underlying engine that Locations Content Translation was removed.

Parameters

  int[] | $locationIds | all Locations of the Content that got Translation removed
  string | $languageCode | language code of the removed Translation

Implemented in eZ\Publish\Core\Persistence\Legacy\Content\UrlAlias\Handler, and eZ\Publish\Core\Persistence\Cache\UrlAliasHandler.

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

- SPI/Persistence/Content/UrlAlias/Handler.php

Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.