PersistedAliasMapper implements PersistedMappableAspectInterface, StaticMappableAspectInterface, SiteLanguageAwareInterface, SiteAwareInterface, UnresolvedValueInterface uses AspectTrait, SiteLanguageAccessorTrait, SiteAccessorTrait, UnresolvedValueTrait
Classic usage when using a "URL segment" (e.g. slug) field within a database table.
Example: routeEnhancers: EventsPlugin: type: Extbase extension: Events2 plugin: Pi1 routes: - { routePath: '/events/{event}', _controller: 'Event::detail', _arguments: {'event': 'event_name'}} defaultController: 'Events2::list' aspects: event: type: PersistedAliasMapper tableName: 'tx_events2_domain_model_event' routeFieldName: 'path_segment' routeValuePrefix: '/'
Table of Contents
Interfaces
- PersistedMappableAspectInterface
- Used for anything that invokes (more expensive) persistence invocations.
- StaticMappableAspectInterface
- Used for anything that has a fixed list of values mapped against route arguments.
- SiteLanguageAwareInterface
- Interface for SiteLanguageAware features of TYPO3
- SiteAwareInterface
- Interface for SiteAware features of TYPO3
- UnresolvedValueInterface
- Provides fallback values for unresolved values during processing mappers.
Properties
- $languageAspect : LanguageAspect
- $languageFieldName : string|null
- $languageParentFieldName : string|null
- $persistenceFieldNames : array<string|int, string>
- $routeFieldName : string
- $routeValuePrefix : string
- $settings : array<string|int, mixed>
- $site : Site
- $siteMatcher : SiteMatcher|null
- $slugUniqueInSite : bool
- $tableName : string
Methods
- __construct() : mixed
- generate() : string|null
- getFallbackValue() : string|null
- getSite() : Site
- hasFallbackValue() : bool
- resolve() : string|null
- setSite() : void
- buildPersistenceFieldNames() : array<string|int, string>
- createPageRepository() : PageRepository
- createQueryBuilder() : QueryBuilder
- filterContainedInSite() : array<string|int, mixed>
- Filters records that are contained in current site (resolved from current SiteLanguage).
- findByIdentifier() : array<string|int, mixed>|null
- findByRouteFieldValue() : array<string|int, mixed>|null
- getLanguageAspect() : LanguageAspect
- Provides LanguageAspect which contains the logic how fallbacks for a given context/overlay-mode shall be handled.
- getSiteMatcher() : SiteMatcher
- hasSlugUniqueInSite() : bool
- isPageIdContainedInSite() : bool
- Determines whether page is contained in current site (resolved from current SiteLanguage).
- isSlugUniqueInSite() : bool
- purgeRouteValuePrefix() : string
- resolveAllRelevantLanguageIds() : array<string|int, int>
- Resolves all language ids that are relevant to retrieve the most specific variant of a record.
- resolveLanguageFallback() : array<string|int, mixed>|null
- Resolves one record out of given language fallbacks.
- resolveOverlay() : array<string|int, mixed>|null
Properties
$languageAspect
protected
LanguageAspect
$languageAspect
$languageFieldName
protected
string|null
$languageFieldName
$languageParentFieldName
protected
string|null
$languageParentFieldName
$persistenceFieldNames
protected
array<string|int, string>
$persistenceFieldNames
$routeFieldName
protected
string
$routeFieldName
$routeValuePrefix
protected
string
$routeValuePrefix
$settings
protected
array<string|int, mixed>
$settings
$site
protected
Site
$site
$siteMatcher
protected
SiteMatcher|null
$siteMatcher
$slugUniqueInSite
protected
bool
$slugUniqueInSite
$tableName
protected
string
$tableName
Methods
__construct()
public
__construct(array<string|int, mixed> $settings) : mixed
Parameters
- $settings : array<string|int, mixed>
Tags
generate()
public
generate(string $value) : string|null
Parameters
- $value : string
Return values
string|nullgetFallbackValue()
public
getFallbackValue() : string|null
Return values
string|nullgetSite()
public
getSite() : Site
Return values
SitehasFallbackValue()
public
hasFallbackValue() : bool
Return values
boolresolve()
public
resolve(string $value) : string|null
Parameters
- $value : string
Return values
string|nullsetSite()
public
setSite(Site $site) : void
Parameters
- $site : Site
buildPersistenceFieldNames()
protected
buildPersistenceFieldNames() : array<string|int, string>
Return values
array<string|int, string>createPageRepository()
protected
createPageRepository() : PageRepository
Return values
PageRepositorycreateQueryBuilder()
protected
createQueryBuilder() : QueryBuilder
Return values
QueryBuilderfilterContainedInSite()
Filters records that are contained in current site (resolved from current SiteLanguage).
protected
filterContainedInSite(array<string|int, mixed> $results) : array<string|int, mixed>
Results keep original indexes and probably needs to
be passed through array_values
for e.g. using the
first result by $results[0]
.
Parameters
- $results : array<string|int, mixed>
Return values
array<string|int, mixed>findByIdentifier()
protected
findByIdentifier(string $value) : array<string|int, mixed>|null
Parameters
- $value : string
Return values
array<string|int, mixed>|nullfindByRouteFieldValue()
protected
findByRouteFieldValue(string $value) : array<string|int, mixed>|null
Parameters
- $value : string
Return values
array<string|int, mixed>|nullgetLanguageAspect()
Provides LanguageAspect which contains the logic how fallbacks for a given context/overlay-mode shall be handled.
protected
getLanguageAspect() : LanguageAspect
Tags
Return values
LanguageAspectgetSiteMatcher()
protected
getSiteMatcher() : SiteMatcher
Return values
SiteMatcherhasSlugUniqueInSite()
protected
hasSlugUniqueInSite(string $tableName, string ...$fieldNames) : bool
Parameters
- $tableName : string
- $fieldNames : string
Return values
boolisPageIdContainedInSite()
Determines whether page is contained in current site (resolved from current SiteLanguage).
protected
isPageIdContainedInSite(int $pageId) : bool
Parameters
- $pageId : int
Return values
boolisSlugUniqueInSite()
protected
isSlugUniqueInSite(string $tableName, string $fieldName) : bool
Parameters
- $tableName : string
- $fieldName : string
Return values
boolpurgeRouteValuePrefix()
protected
purgeRouteValuePrefix(string|null $value) : string
Parameters
- $value : string|null
Return values
stringresolveAllRelevantLanguageIds()
Resolves all language ids that are relevant to retrieve the most specific variant of a record.
protected
resolveAllRelevantLanguageIds() : array<string|int, int>
The order of these ids defines the processing order concerning language fallback - most specific language comes first in this array.
- "all language (-1)", most specific if present since there cannot be any localizations
- "current language" most specific for the current given request context
- "language fallbacks" falling back to language alternatives (might include "default language")
Return values
array<string|int, int>resolveLanguageFallback()
Resolves one record out of given language fallbacks.
protected
resolveLanguageFallback(array<string|int, mixed> $results, string|null $languageFieldName, array<string|int, mixed>|null $languageIds) : array<string|int, mixed>|null
Parameters
- $results : array<string|int, mixed>
- $languageFieldName : string|null
- $languageIds : array<string|int, mixed>|null
Return values
array<string|int, mixed>|nullresolveOverlay()
protected
resolveOverlay(array<string|int, mixed>|null $record) : array<string|int, mixed>|null
Parameters
- $record : array<string|int, mixed>|null