eZPublishCommunityProject  2013.9
eZ\Publish\Core\REST\Client\URLAliasService Class Reference

Implementation of the eZ\Publish\API\Repository\URLAliasServiceinterface. More...

+ Inheritance diagram for eZ\Publish\Core\REST\Client\URLAliasService:
+ Collaboration diagram for eZ\Publish\Core\REST\Client\URLAliasService:

Public Member Functions

 __construct (HttpClient $client, Dispatcher $inputDispatcher, Visitor $outputVisitor, RequestParser $requestParser)
 
 createGlobalUrlAlias ($resource, $path, $languageCode, $forwarding=false, $alwaysAvailable=false)
 Create a user chosen $alias pointing to a resource in $languageCode. More...
 
 createUrlAlias (Location $location, $path, $languageCode, $forwarding=false, $alwaysAvailable=false)
 Create a user chosen $alias pointing to $location in $languageCode. More...
 
 listGlobalAliases ($languageCode=null, $offset=0, $limit=-1)
 List global aliases. More...
 
 listLocationAliases (Location $location, $custom=true, $languageCode=null)
 List of url aliases pointing to $location, sorted by language priority. More...
 
 load ($id)
 Loads URL alias by given $id. More...
 
 lookup ($url, $languageCode=null)
 looks up the URLAlias for the given url. More...
 
 removeAliases (array $aliasList)
 Removes urls aliases. More...
 
 reverseLookup (Location $location, $languageCode=null)
 Returns the URL alias for the given location in the given language. More...
 
 setSession ($id)
 Set session ID. More...
 

Private Attributes

 $client
 
 $inputDispatcher
 
 $outputVisitor
 
 $requestParser
 

Detailed Description

Implementation of the eZ\Publish\API\Repository\URLAliasServiceinterface.

See Also

Constructor & Destructor Documentation

eZ\Publish\Core\REST\Client\URLAliasService::__construct ( HttpClient  $client,
Dispatcher  $inputDispatcher,
Visitor  $outputVisitor,
RequestParser  $requestParser 
)
Parameters
\eZ\Publish\Core\REST\Client\HttpClient$client
\eZ\Publish\Core\REST\Common\Input\Dispatcher$inputDispatcher
\eZ\Publish\Core\REST\Common\Output\Visitor$outputVisitor
\eZ\Publish\Core\REST\Common\RequestParser$requestParser

Member Function Documentation

eZ\Publish\Core\REST\Client\URLAliasService::createGlobalUrlAlias (   $resource,
  $path,
  $languageCode,
  $forwarding = false,
  $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. This method runs URL filters and and transformers before storing them. Hence the path returned in the URLAlias Value may differ from the given.

$alwaysAvailable makes the alias available in all languages.

Exceptions
\eZ\Publish\API\Repository\Exceptions\InvalidArgumentExceptionif the path already exists for the given language or if resource is not valid
Parameters
string$resource
string$path
string$languageCode
boolean$forwarding
boolean$alwaysAvailable
Returns

Implements eZ\Publish\API\Repository\URLAliasService.

eZ\Publish\Core\REST\Client\URLAliasService::createUrlAlias ( Location  $location,
  $path,
  $languageCode,
  $forwarding = false,
  $alwaysAvailable = false 
)

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

This method runs URL filters and transformers before storing them. Hence the path returned in the URLAlias Value may differ from the given. $alwaysAvailable makes the alias available in all languages.

Parameters
\eZ\Publish\API\Repository\Values\Content\Location$location
string$path
string$languageCodethe languageCode for which this alias is valid
boolean$forwardingif true a redirect is performed
boolean$alwaysAvailable
Exceptions
\eZ\Publish\API\Repository\Exceptions\InvalidArgumentExceptionif the path already exists for the given language
Returns

Implements eZ\Publish\API\Repository\URLAliasService.

eZ\Publish\Core\REST\Client\URLAliasService::listGlobalAliases (   $languageCode = null,
  $offset = 0,
  $limit = -1 
)

List global aliases.

Parameters
string$languageCodefilters those which are valid for the given language
int$offset
int$limit
Returns
[]

Implements eZ\Publish\API\Repository\URLAliasService.

eZ\Publish\Core\REST\Client\URLAliasService::listLocationAliases ( Location  $location,
  $custom = true,
  $languageCode = null 
)

List of url aliases pointing to $location, sorted by language priority.

Parameters
\eZ\Publish\API\Repository\Values\Content\Location$location
boolean$customif true the user generated aliases are listed otherwise the autogenerated
string$languageCodefilters those which are valid for the given language
Returns
[]

Implements eZ\Publish\API\Repository\URLAliasService.

eZ\Publish\Core\REST\Client\URLAliasService::load (   $id)

Loads URL alias by given $id.

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

Implements eZ\Publish\API\Repository\URLAliasService.

eZ\Publish\Core\REST\Client\URLAliasService::lookup (   $url,
  $languageCode = null 
)

looks up the URLAlias for the given url.

Parameters
string$url
string$languageCode
Exceptions
\eZ\Publish\API\Repository\Exceptions\NotFoundExceptionif the path does not exist or is not valid for the given language
Returns

Implements eZ\Publish\API\Repository\URLAliasService.

eZ\Publish\Core\REST\Client\URLAliasService::removeAliases ( array  $aliasList)

Removes urls aliases.

This method does not remove autogenerated aliases for locations.

Exceptions
\eZ\Publish\API\Repository\Exceptions\InvalidArgumentExceptionif alias list contains autogenerated alias
Parameters
\eZ\Publish\API\Repository\Values\Content\URLAlias[]$aliasList
Returns
void

Implements eZ\Publish\API\Repository\URLAliasService.

eZ\Publish\Core\REST\Client\URLAliasService::reverseLookup ( Location  $location,
  $languageCode = null 
)

Returns the URL alias for the given location in the given language.

If $languageCode is null the method returns the url alias in the most prioritized language.

Exceptions
\eZ\Publish\API\Repository\Exceptions\NotFoundExceptionif no url alias exist for the given language
Parameters
\eZ\Publish\API\Repository\Values\Content\Location$location
string$languageCode
Returns

Implements eZ\Publish\API\Repository\URLAliasService.

eZ\Publish\Core\REST\Client\URLAliasService::setSession (   $id)

Set session ID.

Only for testing

Parameters
mixed$id

Implements eZ\Publish\Core\REST\Client\Sessionable.

Member Data Documentation

eZ\Publish\Core\REST\Client\URLAliasService::$client
private
eZ\Publish\Core\REST\Client\URLAliasService::$inputDispatcher
private
eZ\Publish\Core\REST\Client\URLAliasService::$outputVisitor
private
eZ\Publish\Core\REST\Client\URLAliasService::$requestParser
private

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