PHP Класс eZ\Publish\Core\MVC\Symfony\Routing\UrlAliasRouter

Наследование: implements Symfony\Cmf\Component\Routing\ChainedRouterInterface, implements Symfony\Component\Routing\Matcher\RequestMatcherInterface
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$contentService eZ\Publish\API\Repository\ContentService
$generator eZ\Publish\Core\MVC\Symfony\Routing\Generator\UrlAliasGenerator
$locationService eZ\Publish\API\Repository\LocationService
$logger Psr\Log\LoggerInterface
$requestContext Symfony\Component\Routing\RequestContext
$rootLocationId integer | string Holds current root Location id.
$urlAliasService eZ\Publish\API\Repository\URLAliasService

Открытые методы

Метод Описание
__construct ( eZ\Publish\API\Repository\LocationService $locationService, eZ\Publish\API\Repository\URLAliasService $urlAliasService, eZ\Publish\API\Repository\ContentService $contentService, UrlAliasGenerator $generator, Symfony\Component\Routing\RequestContext $requestContext, Psr\Log\LoggerInterface $logger = null )
generate ( string | eZ\Publish\API\Repository\Values\Content\Location $name, mixed $parameters = [], integer $referenceType = UrlGeneratorInterface::ABSOLUTE_PATH ) : string Generates a URL for a location, from the given parameters.
getContext ( )
getRouteCollection ( ) : RouteCollection Gets the RouteCollection instance associated with this Router.
getRouteDebugMessage ( $name, array $parameters = [] )
match ( $pathinfo ) Not supported. Please use matchRequest() instead.
matchRequest ( Request $request ) : array Tries to match a request with a set of routes.
setContext ( Symfony\Component\Routing\RequestContext $context )
setRootLocationId ( integer | string $rootLocationId ) Injects current root Location id.
supports ( mixed $name ) : boolean Whether the router supports the thing in $name to generate a route.

Защищенные методы

Метод Описание
getUrlAlias ( $pathinfo ) : eZ\Publish\API\Repository\Values\Content\URLAlias Returns the UrlAlias object to use, starting from the request.
needsCaseRedirect ( eZ\Publish\API\Repository\Values\Content\URLAlias $loadedUrlAlias, string $requestedPath, string $pathPrefix ) : boolean Returns true of false on comparing $urlAlias->path and $path with case sensitivity.
removePathPrefix ( string $path, string $prefix ) : string Removes prefix from path.

Описание методов

__construct() публичный Метод

public __construct ( eZ\Publish\API\Repository\LocationService $locationService, eZ\Publish\API\Repository\URLAliasService $urlAliasService, eZ\Publish\API\Repository\ContentService $contentService, UrlAliasGenerator $generator, Symfony\Component\Routing\RequestContext $requestContext, Psr\Log\LoggerInterface $logger = null )
$locationService eZ\Publish\API\Repository\LocationService
$urlAliasService eZ\Publish\API\Repository\URLAliasService
$contentService eZ\Publish\API\Repository\ContentService
$generator eZ\Publish\Core\MVC\Symfony\Routing\Generator\UrlAliasGenerator
$requestContext Symfony\Component\Routing\RequestContext
$logger Psr\Log\LoggerInterface

generate() публичный Метод

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\Publish\API\Repository\Values\Content\Location object. "locationId" can also be provided. If the generator is not able to generate the url, it must throw the RouteNotFoundException as documented below.
См. также: UrlAliasRouter::supports()
public generate ( string | eZ\Publish\API\Repository\Values\Content\Location $name, mixed $parameters = [], integer $referenceType = UrlGeneratorInterface::ABSOLUTE_PATH ) : string
$name string | eZ\Publish\API\Repository\Values\Content\Location The name of the route or a Location instance
$parameters mixed An array of parameters
$referenceType integer The type of reference to be generated (one of the constants)
Результат string The generated URL

getContext() публичный Метод

public getContext ( )

getRouteCollection() публичный Метод

Gets the RouteCollection instance associated with this Router.
public getRouteCollection ( ) : RouteCollection
Результат Symfony\Component\Routing\RouteCollection A RouteCollection instance

getRouteDebugMessage() публичный Метод

См. также: Symfony\Cmf\Component\Routing\VersatileGeneratorInterface::getRouteDebugMessage()
public getRouteDebugMessage ( $name, array $parameters = [] )
$parameters array

getUrlAlias() защищенный Метод

Returns the UrlAlias object to use, starting from the request.
protected getUrlAlias ( $pathinfo ) : eZ\Publish\API\Repository\Values\Content\URLAlias
$pathinfo
Результат eZ\Publish\API\Repository\Values\Content\URLAlias

match() публичный Метод

Not supported. Please use matchRequest() instead.
public match ( $pathinfo )
$pathinfo

matchRequest() публичный Метод

If the matcher can not find information, it must throw one of the exceptions documented below.
public matchRequest ( Request $request ) : array
$request Symfony\Component\HttpFoundation\Request The request to match
Результат array An array of parameters

needsCaseRedirect() защищенный Метод

Used to determine if redirect is needed because requested path is case-different from the stored one.
protected needsCaseRedirect ( eZ\Publish\API\Repository\Values\Content\URLAlias $loadedUrlAlias, string $requestedPath, string $pathPrefix ) : boolean
$loadedUrlAlias eZ\Publish\API\Repository\Values\Content\URLAlias
$requestedPath string
$pathPrefix string
Результат boolean

removePathPrefix() защищенный Метод

Checks for presence of $prefix and removes it from $path if found.
protected removePathPrefix ( string $path, string $prefix ) : string
$path string
$prefix string
Результат string

setContext() публичный Метод

public setContext ( Symfony\Component\Routing\RequestContext $context )
$context Symfony\Component\Routing\RequestContext

setRootLocationId() публичный Метод

Injects current root Location id.
public setRootLocationId ( integer | string $rootLocationId )
$rootLocationId integer | string

supports() публичный Метод

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.
public supports ( mixed $name ) : boolean
$name mixed The route name or route object
Результат boolean

Описание свойств

$contentService защищенное свойство

protected ContentService,eZ\Publish\API\Repository $contentService
Результат eZ\Publish\API\Repository\ContentService

$generator защищенное свойство

protected UrlAliasGenerator,eZ\Publish\Core\MVC\Symfony\Routing\Generator $generator
Результат eZ\Publish\Core\MVC\Symfony\Routing\Generator\UrlAliasGenerator

$locationService защищенное свойство

protected LocationService,eZ\Publish\API\Repository $locationService
Результат eZ\Publish\API\Repository\LocationService

$logger защищенное свойство

protected LoggerInterface,Psr\Log $logger
Результат Psr\Log\LoggerInterface

$requestContext защищенное свойство

protected RequestContext,Symfony\Component\Routing $requestContext
Результат Symfony\Component\Routing\RequestContext

$rootLocationId защищенное свойство

Holds current root Location id.
protected int|string $rootLocationId
Результат integer | string

$urlAliasService защищенное свойство

protected URLAliasService,eZ\Publish\API\Repository $urlAliasService
Результат eZ\Publish\API\Repository\URLAliasService