‪TYPO3CMS  ‪main
TYPO3\CMS\Redirects\Service\SlugService Class Reference
Inheritance diagram for TYPO3\CMS\Redirects\Service\SlugService:

Public Member Functions

 __construct (private readonly Context $context, private readonly PageRepository $pageRepository, private readonly LinkService $linkService, private readonly RedirectCacheService $redirectCacheService, private readonly SlugRedirectChangeItemFactory $slugRedirectChangeItemFactory, private readonly EventDispatcherInterface $eventDispatcher, private readonly ConnectionPool $connectionPool,)
 
 rebuildSlugsForSlugChange (int $pageId, SlugRedirectChangeItem $changeItem, CorrelationId $correlationId)
 

Public Attributes

final const CORRELATION_ID_IDENTIFIER = '5d8e6e70'
 
 $table = $connection->getSchemaInformation()->introspectTable($tableName)
 
foreach($table->getColumns() as $column) return $defaults
 

Protected Member Functions

 initializeSettings (Site $site)
 
 createCorrelationIds (int $pageId, CorrelationId $correlationId)
 
string[] createRedirects (SlugRedirectChangeItem $changeItem, int $pageId, int $languageId)
 
string[] checkSubPages (array $currentPageRecord, SlugRedirectChangeItem $parentChangeItem)
 
 resolveSubPages (int $id, int $languageUid)
 
 updateSlug (array $subPageRecord, SlugRedirectChangeItem $changeItem)
 
 persistNewSlug (int $uid, string $newSlug)
 
 sendNotification ()
 
 getRecordHistoryStore ()
 
 getQueryBuilderForPages ()
 
 enabledHook ()
 
 disableHook ()
 
 getBackendUser ()
 

Protected Attributes

CorrelationId string $correlationIdRedirectCreation = ''
 
CorrelationId string $correlationIdSlugUpdate = ''
 
bool $autoUpdateSlugs = false
 
bool $autoCreateRedirects = false
 
int $redirectTTL = 0
 
int $httpStatusCode = 307
 

Private Member Functions

array< non-empty-string, getTableDefaultValues(string $tableName):array { $defaults=[];foreach( $GLOBALS[ 'TCA'][ $tableName][ 'columns'] ??[] as $columnName=> $columnConfig) { if(!array_key_exists( 'default', $columnConfig[ 'config'] ??[])) { continue;} $defaults[ $columnName]=$columnConfig[ 'config'][ 'default'];} $connection=$this-> connectionPool getConnectionForTable ($tableName)
 

Detailed Description

Due to some possible refactorings in TYPO3 v10+

Definition at line 51 of file SlugService.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Redirects\Service\SlugService::__construct ( private readonly Context  $context,
private readonly PageRepository  $pageRepository,
private readonly LinkService  $linkService,
private readonly RedirectCacheService  $redirectCacheService,
private readonly SlugRedirectChangeItemFactory  $slugRedirectChangeItemFactory,
private readonly EventDispatcherInterface  $eventDispatcher,
private readonly ConnectionPool  $connectionPool 
)

Definition at line 67 of file SlugService.php.

Member Function Documentation

◆ checkSubPages()

string [] TYPO3\CMS\Redirects\Service\SlugService::checkSubPages ( array  $currentPageRecord,
SlugRedirectChangeItem  $parentChangeItem 
)
protected

◆ createCorrelationIds()

◆ createRedirects()

◆ disableHook()

TYPO3\CMS\Redirects\Service\SlugService::disableHook ( )
protected

Definition at line 354 of file SlugService.php.

References $GLOBALS.

Referenced by TYPO3\CMS\Redirects\Service\SlugService\persistNewSlug().

◆ enabledHook()

TYPO3\CMS\Redirects\Service\SlugService::enabledHook ( )
protected

Definition at line 348 of file SlugService.php.

References $GLOBALS.

Referenced by TYPO3\CMS\Redirects\Service\SlugService\persistNewSlug().

◆ getBackendUser()

TYPO3\CMS\Redirects\Service\SlugService::getBackendUser ( )
protected

Definition at line 359 of file SlugService.php.

References $GLOBALS.

Referenced by TYPO3\CMS\Redirects\Service\SlugService\getRecordHistoryStore().

◆ getConnectionForTable()

array<non-empty-string, getTableDefaultValues(string $tableName): array { $defaults = []; foreach ($GLOBALS['TCA'][$tableName]['columns'] ?? [] as $columnName => $columnConfig) { if (!array_key_exists('default', $columnConfig['config'] ?? [])) { continue; } $defaults[$columnName] = $columnConfig['config']['default']; } $connection = $this-> connectionPool TYPO3\CMS\Redirects\Service\SlugService::getConnectionForTable (   $tableName)
private

Gather table default values from TCA and from the cached table schema information as fallback.

Parameters
string$tableName
Returns
‪array<non-empty-string, string|float|int|bool|null>
Todo:
‪Consider to provide this in Connection if use-full for different places.

◆ getQueryBuilderForPages()

TYPO3\CMS\Redirects\Service\SlugService::getQueryBuilderForPages ( )
protected

◆ getRecordHistoryStore()

TYPO3\CMS\Redirects\Service\SlugService::getRecordHistoryStore ( )
protected

◆ initializeSettings()

TYPO3\CMS\Redirects\Service\SlugService::initializeSettings ( Site  $site)
protected

◆ persistNewSlug()

TYPO3\CMS\Redirects\Service\SlugService::persistNewSlug ( int  $uid,
string  $newSlug 
)
protected

◆ rebuildSlugsForSlugChange()

◆ resolveSubPages()

TYPO3\CMS\Redirects\Service\SlugService::resolveSubPages ( int  $id,
int  $languageUid 
)
protected

◆ sendNotification()

◆ updateSlug()

TYPO3\CMS\Redirects\Service\SlugService::updateSlug ( array  $subPageRecord,
SlugRedirectChangeItem  $changeItem 
)
protected

Member Data Documentation

◆ $autoCreateRedirects

bool TYPO3\CMS\Redirects\Service\SlugService::$autoCreateRedirects = false
protected

◆ $autoUpdateSlugs

bool TYPO3\CMS\Redirects\Service\SlugService::$autoUpdateSlugs = false
protected

Definition at line 62 of file SlugService.php.

◆ $correlationIdRedirectCreation

CorrelationId string TYPO3\CMS\Redirects\Service\SlugService::$correlationIdRedirectCreation = ''
protected

◆ $correlationIdSlugUpdate

CorrelationId string TYPO3\CMS\Redirects\Service\SlugService::$correlationIdSlugUpdate = ''
protected

Definition at line 61 of file SlugService.php.

◆ $defaults

foreach ( $table->getColumns() as $column) return TYPO3\CMS\Redirects\Service\SlugService::$defaults

Definition at line 401 of file SlugService.php.

◆ $httpStatusCode

int TYPO3\CMS\Redirects\Service\SlugService::$httpStatusCode = 307
protected

Definition at line 65 of file SlugService.php.

◆ $redirectTTL

int TYPO3\CMS\Redirects\Service\SlugService::$redirectTTL = 0
protected

Definition at line 64 of file SlugService.php.

◆ $table

TYPO3\CMS\Redirects\Service\SlugService::$table = $connection->getSchemaInformation()->introspectTable($tableName)

Definition at line 381 of file SlugService.php.

◆ CORRELATION_ID_IDENTIFIER

final const TYPO3\CMS\Redirects\Service\SlugService::CORRELATION_ID_IDENTIFIER = '5d8e6e70'

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

Definition at line 58 of file SlugService.php.

Referenced by TYPO3\CMS\Redirects\Hooks\DataHandlerSlugUpdateHook\isNestedHookInvocation(), and TYPO3\CMS\Redirects\Controller\RecordHistoryRollbackController\revertCorrelation().