PersistedAliasMapper implements PersistedMappableAspectInterface, StaticMappableAspectInterface, ContextAwareInterface, SiteLanguageAwareInterface, SiteAwareInterface uses AspectTrait, SiteLanguageAccessorTrait, SiteAccessorTrait, ContextAwareTrait

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.
ContextAwareInterface
SiteLanguageAwareInterface
Interface for SiteLanguageAware features of TYPO3
SiteAwareInterface
Interface for SiteAware features of TYPO3

Properties

$context  : Context
$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
getContext()  : Context
getSite()  : Site
resolve()  : string|null
setContext()  : void
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

$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

$slugUniqueInSite

protected bool $slugUniqueInSite

Methods

__construct()

public __construct(array<string|int, mixed> $settings) : mixed
Parameters
$settings : array<string|int, mixed>
Tags
throws
InvalidArgumentException

generate()

public generate(string $value) : string|null
Parameters
$value : string
Return values
string|null

resolve()

public resolve(string $value) : string|null
Parameters
$value : string
Return values
string|null

buildPersistenceFieldNames()

protected buildPersistenceFieldNames() : array<string|int, string>
Return values
array<string|int, string>

filterContainedInSite()

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>|null

findByRouteFieldValue()

protected findByRouteFieldValue(string $value) : array<string|int, mixed>|null
Parameters
$value : string
Return values
array<string|int, mixed>|null

getLanguageAspect()

Provides LanguageAspect which contains the logic how fallbacks for a given context/overlay-mode shall be handled.

protected getLanguageAspect() : LanguageAspect
Tags
see
LanguageAspectFactory::createFromSiteLanguage
Return values
LanguageAspect

hasSlugUniqueInSite()

protected hasSlugUniqueInSite(string $tableName, string ...$fieldNames) : bool
Parameters
$tableName : string
$fieldNames : string
Return values
bool

isPageIdContainedInSite()

Determines whether page is contained in current site (resolved from current SiteLanguage).

protected isPageIdContainedInSite(int $pageId) : bool
Parameters
$pageId : int
Return values
bool

isSlugUniqueInSite()

protected isSlugUniqueInSite(string $tableName, string $fieldName) : bool
Parameters
$tableName : string
$fieldName : string
Return values
bool

purgeRouteValuePrefix()

protected purgeRouteValuePrefix(string|null $value) : string
Parameters
$value : string|null
Return values
string

resolveAllRelevantLanguageIds()

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>|null

resolveOverlay()

protected resolveOverlay(array<string|int, mixed>|null $record) : array<string|int, mixed>|null
Parameters
$record : array<string|int, mixed>|null
Return values
array<string|int, mixed>|null

        
On this page

Search results