SlugService

class \TYPO3\CMS\Redirects\Service\SlugService

Implements
LoggerAwareInterface
Uses
LoggerAwareTrait

Table of Contents

Interfaces

LoggerAwareInterface

Constants

CORRELATION_ID_IDENTIFIER  : mixed = '5d8e6e70'
`dechex(1569615472)` (similar to timestamps used with exceptions, but in hex)

Properties

$autoCreateRedirects  : bool
$autoUpdateSlugs  : bool
$correlationIdPageUpdate  : CorrelationId|null
$correlationIdRedirectCreation  : CorrelationId|null
$correlationIdSlugUpdate  : CorrelationId|null
$createdRedirects  : int
$httpStatusCode  : int
$notifications  : array
Notifications of all pages whose slug changed within the current request
$redirectTTL  : int
$referenceIndexUpdater  : ReferenceIndexUpdater|null
$updatedSubPages  : int

Methods

__construct()  : mixed
rebuildSlugsForSlugChange()  : void
checkSubPages()  : string[]
createCorrelationIds()  : void
createRedirects()  : string[]
disableHook()  : void
enabledHook()  : void
getBackendUser()  : BackendUserAuthentication
getQueryBuilderForPages()  : QueryBuilder
initializeSettings()  : void
persistNewSlug()  : void
resolveSubPages()  : array
sendNotification()  : void
updateSlug()  : array|null
Update a slug by given record, old parent page slug and new parent page slug.

Constants

CORRELATION_ID_IDENTIFIER

`dechex(1569615472)` (similar to timestamps used with exceptions, but in hex)

public final mixed CORRELATION_ID_IDENTIFIER = '5d8e6e70'

Properties

$autoCreateRedirects

protected bool $autoCreateRedirects = false

$autoUpdateSlugs

protected bool $autoUpdateSlugs = false

$createdRedirects

protected int $createdRedirects = 0

$httpStatusCode

protected int $httpStatusCode = 307

$notifications

Notifications of all pages whose slug changed within the current request

protected array $notifications = []

$redirectTTL

protected int $redirectTTL = 0

$updatedSubPages

protected int $updatedSubPages = 0

Methods

__construct()

public __construct(Context $context, PageRepository $pageRepository, LinkService $linkService, RedirectCacheService $redirectCacheService, SlugRedirectChangeItemFactory $slugRedirectChangeItemFactory, EventDispatcherInterface $eventDispatcher, ConnectionPool $connectionPool, TcaSchemaFactory $tcaSchemaFactory, TemporaryPermissionMutationService $temporaryPermissionMutationService) : mixed

Parameters

$context : Context
$pageRepository : PageRepository
$linkService : LinkService
$redirectCacheService : RedirectCacheService
$slugRedirectChangeItemFactory : SlugRedirectChangeItemFactory
$eventDispatcher : EventDispatcherInterface
$connectionPool : ConnectionPool
$tcaSchemaFactory : TcaSchemaFactory
$temporaryPermissionMutationService : TemporaryPermissionMutationService

rebuildSlugsForSlugChange()

public rebuildSlugsForSlugChange(int $pageId, SlugRedirectChangeItem $changeItem, CorrelationId $correlationId[, ReferenceIndexUpdater|null $referenceIndexUpdater = null ]) : void

Parameters

$pageId : int
$changeItem : SlugRedirectChangeItem
$correlationId : CorrelationId
$referenceIndexUpdater : ReferenceIndexUpdater|null = null

The one of the DataHandler changing the slug, which updates the reference index of created redirects and sub pages when it has finished

checkSubPages()

protected checkSubPages(array $currentPageRecord, SlugRedirectChangeItem $parentChangeItem) : string[]

Parameters

$currentPageRecord : array
$parentChangeItem : SlugRedirectChangeItem

Return values

string[] —

All unique source hosts for created redirects.

disableHook()

protected disableHook() : void

enabledHook()

protected enabledHook() : void

initializeSettings()

protected initializeSettings(Site $site) : void

Parameters

$site : Site

persistNewSlug()

protected persistNewSlug(int $uid, string $newSlug) : void

Parameters

$uid : int
$newSlug : string

resolveSubPages()

protected resolveSubPages(int $id, int $languageUid) : array

Parameters

$id : int
$languageUid : int

Return values

array

updateSlug()

Update a slug by given record, old parent page slug and new parent page slug.

protected updateSlug(array $subPageRecord, SlugRedirectChangeItem $changeItem) : array|null

In case no update is required, the method returns null else the new slug.

Parameters

$subPageRecord : array
$changeItem : SlugRedirectChangeItem

Return values

array|null
On this page