PHP Класс Neos\Flow\Mvc\Routing\IdentityRoutePart

This handler is used by default, if an objectType is specified for a route part in the routing configuration: - name: 'Some route for xyz entities' uriPattern: '{xyz}' routeParts: 'xyz': objectType: 'Some\Package\Domain\Model\Xyz'
См. также: Neos\Flow\Mvc\Routing\ObjectPathMapping
Наследование: extends DynamicRoutePart
Показать файл Открыть проект Примеры использования класса

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

Свойство Тип Описание
$objectPathMappingRepository ObjectPathMappingRepository
$objectType string The object type (class name) of the entity this route part belongs to
$persistenceManager Neos\Flow\Persistence\PersistenceManagerInterface
$reflectionService Neos\Flow\Reflection\ReflectionService
$uriPattern string pattern for the URI representation (for example "{date:Y}/{date:m}/{date.d}/{title}")

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

Метод Описание
getObjectType ( ) : string
getUriPattern ( ) : string If $this->uriPattern is specified, this will be returned, otherwise identity properties of $this->objectType are returned in the format {property1}/{property2}/{property3}.
setObjectType ( string $objectType ) : void
setUriPattern ( string $uriPattern ) : void

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

Метод Описание
createPathSegmentForObject ( mixed $object ) : string Creates a URI representation (path segment) for the given object matching $this->uriPattern.
findValueToMatch ( string $routePath ) : string Returns the first part of $routePath that should be evaluated in matchValue().
getObjectIdentifierFromPathSegment ( string $pathSegment ) : string | integer Retrieves the object identifier from the given $pathSegment.
getPathSegmentByIdentifier ( string $identifier ) : string | integer Generates a unique string for the given identifier according to $this->uriPattern.
matchValue ( string $value ) : boolean Checks, whether given value can be matched.
resolveValue ( mixed $value ) : boolean Resolves the given entity and sets the value to a URI representation (path segment) that matches $this->uriPattern and is unique for the given object.
rewriteForUri ( string $value ) : string Transforms the given string into a URI compatible format without special characters.
storeObjectPathMapping ( string $pathSegment, string | integer $identifier ) : void Creates a new ObjectPathMapping and stores it in the repository

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

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

Creates a URI representation (path segment) for the given object matching $this->uriPattern.
protected createPathSegmentForObject ( mixed $object ) : string
$object mixed object of type $this->objectType
Результат string URI representation (path segment) of the given object

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

If no split string is set (route part is the last in the routes uriPattern), the complete $routePart is returned. Otherwise the part is returned that matches the specified uriPattern of this route part.
protected findValueToMatch ( string $routePath ) : string
$routePath string The request path to be matched
Результат string value to match, or an empty string if $routePath is empty, split string was not found or uriPattern could not be matched

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

If no UriPattern is set, the $pathSegment is expected to be the (URL-encoded) identifier otherwise a matching ObjectPathMapping fetched from persistence If no matching ObjectPathMapping was found or the given $pathSegment is no valid identifier NULL is returned.
protected getObjectIdentifierFromPathSegment ( string $pathSegment ) : string | integer
$pathSegment string the query path segment to convert
Результат string | integer the technical identifier of the object or NULL if it couldn't be found

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

public getObjectType ( ) : string
Результат string

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

If no UriPattern is set, the path segment is equal to the (URL-encoded) $identifier - otherwise a matching ObjectPathMapping is fetched from persistence. If no ObjectPathMapping exists for the given identifier, a new ObjectPathMapping is created.
protected getPathSegmentByIdentifier ( string $identifier ) : string | integer
$identifier string the technical identifier of the object
Результат string | integer the resolved path segment(s)

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

If $this->objectType does not contain identity properties, an empty string is returned.
public getUriPattern ( ) : string
Результат string

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

If the value is empty, FALSE is returned. Otherwise the ObjectPathMappingRepository is asked for a matching ObjectPathMapping. If that is found the identifier is stored in $this->value, otherwise this route part does not match.
protected matchValue ( string $value ) : boolean
$value string value to match, usually the current query path segment(s)
Результат boolean TRUE if value could be matched successfully, otherwise FALSE

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

Resolves the given entity and sets the value to a URI representation (path segment) that matches $this->uriPattern and is unique for the given object.
protected resolveValue ( mixed $value ) : boolean
$value mixed
Результат boolean TRUE if the object could be resolved and stored in $this->value, otherwise FALSE.

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

In the long term this should be done with proper transliteration
protected rewriteForUri ( string $value ) : string
$value string
Результат string

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

public setObjectType ( string $objectType ) : void
$objectType string
Результат void

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

public setUriPattern ( string $uriPattern ) : void
$uriPattern string
Результат void

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

Creates a new ObjectPathMapping and stores it in the repository
protected storeObjectPathMapping ( string $pathSegment, string | integer $identifier ) : void
$pathSegment string
$identifier string | integer
Результат void

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

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

protected ObjectPathMappingRepository,Neos\Flow\Mvc\Routing $objectPathMappingRepository
Результат ObjectPathMappingRepository

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

The object type (class name) of the entity this route part belongs to
protected string $objectType
Результат string

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

protected PersistenceManagerInterface,Neos\Flow\Persistence $persistenceManager
Результат Neos\Flow\Persistence\PersistenceManagerInterface

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

protected ReflectionService,Neos\Flow\Reflection $reflectionService
Результат Neos\Flow\Reflection\ReflectionService

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

pattern for the URI representation (for example "{date:Y}/{date:m}/{date.d}/{title}")
protected string $uriPattern
Результат string