eZPublishCommunityProject  2012.12
eZ\Publish\Core\MVC\Symfony\Routing\UrlAliasRouter Class Reference
+ Inheritance diagram for eZ\Publish\Core\MVC\Symfony\Routing\UrlAliasRouter:
+ Collaboration diagram for eZ\Publish\Core\MVC\Symfony\Routing\UrlAliasRouter:

Public Member Functions

 __construct (\Closure $lazyRepository, UrlAliasGenerator $generator, RequestContext $requestContext, LoggerInterface $logger=null)
 
 generate ($name, $parameters=array(), $absolute=false)
 Generates a URL for a location, from the given parameters. More...
 
 getContext ()
 
 getRouteCollection ()
 Gets the RouteCollection instance associated with this Router. More...
 
 match ($pathinfo)
 Not supported. More...
 
 matchRequest (Request $request)
 Tries to match a request with a set of routes. More...
 
 setContext (RequestContext $context)
 
 supports ($name)
 Whether the router supports the thing in $name to generate a route. More...
 

Public Attributes

const URL_ALIAS_ROUTE_NAME = 'ez_urlalias'
 

Protected Member Functions

 getRepository ()
 

Protected Attributes

 $generator
 
 $lazyRepository
 
 $logger
 
 $repository
 
 $requestContext
 
 $urlAliasService
 

Constructor & Destructor Documentation

eZ\Publish\Core\MVC\Symfony\Routing\UrlAliasRouter::__construct ( \Closure  $lazyRepository,
UrlAliasGenerator  $generator,
RequestContext  $requestContext,
LoggerInterface  $logger = null 
)

Member Function Documentation

eZ\Publish\Core\MVC\Symfony\Routing\UrlAliasRouter::generate (   $name,
  $parameters = array(),
  $absolute = false 
)

Generates a URL for a location, from the given parameters.

It is possible to directly pass a Location object as the route name, as the ChainRouter allows it through ChainedRouterInterface.

If $name is a route name, the "location" key in $parameters must be set to a valid eZ object. "locationId" can also be provided.

If the generator is not able to generate the url, it must throw the RouteNotFoundException as documented below.

See Also
UrlAliasRouter::supports()
Parameters
string | \eZ\Publish\API\Repository\Values\Content\Location$nameThe name of the route or a Location instance
mixed$parametersAn array of parameters
boolean$absoluteWhether to generate an absolute URL
Exceptions
\LogicException
\Symfony\Component\Routing\Exception\RouteNotFoundException
\InvalidArgumentException
Returns
string The generated URL
eZ\Publish\Core\MVC\Symfony\Routing\UrlAliasRouter::getContext ( )
eZ\Publish\Core\MVC\Symfony\Routing\UrlAliasRouter::getRepository ( )
protected
eZ\Publish\Core\MVC\Symfony\Routing\UrlAliasRouter::getRouteCollection ( )

Gets the RouteCollection instance associated with this Router.

Returns
RouteCollection A RouteCollection instance
eZ\Publish\Core\MVC\Symfony\Routing\UrlAliasRouter::match (   $pathinfo)

Not supported.

Please use matchRequest() instead.

Parameters
$pathinfo
Exceptions
\RuntimeException
Returns
void
eZ\Publish\Core\MVC\Symfony\Routing\UrlAliasRouter::matchRequest ( Request  $request)

Tries to match a request with a set of routes.

If the matcher can not find information, it must throw one of the exceptions documented below.

Parameters
Request$requestThe request to match
Returns
array An array of parameters
Exceptions
\Symfony\Component\Routing\Exception\ResourceNotFoundExceptionIf no matching resource could be found
MethodNotAllowedExceptionIf a matching resource was found but the request method is not allowed
eZ\Publish\Core\MVC\Symfony\Routing\UrlAliasRouter::setContext ( RequestContext  $context)
eZ\Publish\Core\MVC\Symfony\Routing\UrlAliasRouter::supports (   $name)

Whether the router supports the thing in $name to generate a route.

This check does not need to look if the specific instance can be resolved to a route, only whether the router can generate routes from objects of this class.

Parameters
mixed$nameThe route name or route object
Returns
boolean

Member Data Documentation

eZ\Publish\Core\MVC\Symfony\Routing\UrlAliasRouter::$generator
protected
eZ\Publish\Core\MVC\Symfony\Routing\UrlAliasRouter::$lazyRepository
protected
eZ\Publish\Core\MVC\Symfony\Routing\UrlAliasRouter::$logger
protected
eZ\Publish\Core\MVC\Symfony\Routing\UrlAliasRouter::$repository
protected
eZ\Publish\Core\MVC\Symfony\Routing\UrlAliasRouter::$requestContext
protected
eZ\Publish\Core\MVC\Symfony\Routing\UrlAliasRouter::$urlAliasService
protected
const eZ\Publish\Core\MVC\Symfony\Routing\UrlAliasRouter::URL_ALIAS_ROUTE_NAME = 'ez_urlalias'

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