eZPublishCommunityProject  2013.4
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

 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...
 
 loadUrlAlias ($id)
 Loads URL alias by given $id. More...
 
 locationCopied ($locationId, $oldParentId, $newParentId)
 Notifies the underlying engine that a location has moved. More...
 
 locationDeleted ($locationId)
 Notifies the underlying engine that a location was deleted or moved to trash. More...
 
 locationMoved ($locationId, $oldParentId, $newParentId)
 Notifies the underlying engine that a location has moved. More...
 
 lookup ($url)
 Looks up a url alias for the given url. More...
 
 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...
 
 removeURLAliases (array $urlAliases)
 Removes url aliases. 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.

Member Function Documentation

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
boolean$forwarding
string | null$languageCode
boolean$alwaysAvailable
Returns

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

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
boolean$forwarding
string | null$languageCode
boolean$alwaysAvailable
Returns

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

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

List global aliases.

Parameters
string | null$languageCode
int$offset
int$limit
Returns
[]

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

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

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

Parameters
mixed$locationId
boolean$customif true the user generated aliases are listed otherwise the autogenerated
Returns
[]

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

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

Loads URL alias by given $id.

Exceptions
\eZ\Publish\API\Repository\Exceptions\NotFoundException
Parameters
string$id
Returns

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

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

Notifies the underlying engine that a location has moved.

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

Parameters
mixed$locationId
mixed$oldParentId
mixed$newParentId

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

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

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

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.

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

Looks up a url alias for the given url.

Exceptions
\eZ\Publish\API\Repository\Exceptions\NotFoundException
Parameters
string$url
Returns

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

eZ\Publish\Core\Persistence\Legacy\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$namethe new name computed by the name schema or url alias schema
string$languageCode
boolean$alwaysAvailable
Returns
void

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$namethe new name computed by the name schema or url alias schema
string$languageCode
boolean$alwaysAvailable
boolean$updatePathIdentificationStringlegacy storage specific for updating ezcontentobject_tree.path_identification_string
Returns
void

Implemented in eZ\Publish\Core\Persistence\InMemory\UrlAliasHandler, and eZ\Publish\Core\Persistence\Cache\UrlAliasHandler.

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
boolean

Implemented in eZ\Publish\Core\Persistence\InMemory\UrlAliasHandler, 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 files: