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
파일 보기 프로젝트 열기: neos/flow-development-collection 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$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