ReferenceIndex

class \TYPO3\CMS\Core\Database\ReferenceIndex

Reference index processing and relation extraction.

Attributes

#[Autoconfigure]
$public: true

Table of Contents

Methods

__construct()  : mixed
getNumberOfReferencedRecords()  : int
Returns the amount of references for the given record.
getRelations()  : array
Returns relation information for a record from a TCA table.
updateIndex()  : array
Update full refindex. Used by 'referenceindex:update' CLI and ext:lowlevel BE UI.
updateRefIndexTable()  : array
Update the sys_refindex table for a record, even one just deleted.

Methods

__construct()

public __construct(EventDispatcherInterface $eventDispatcher, SoftReferenceParserFactory $softReferenceParserFactory, ConnectionPool $connectionPool, Registry $registry, FlexFormTools $flexFormTools, TcaSchemaFactory $tcaSchemaFactory) : mixed

Parameters

$eventDispatcher : EventDispatcherInterface
$softReferenceParserFactory : SoftReferenceParserFactory
$connectionPool : ConnectionPool
$registry : Registry
$flexFormTools : FlexFormTools
$tcaSchemaFactory : TcaSchemaFactory

getNumberOfReferencedRecords()

Returns the amount of references for the given record.

public getNumberOfReferencedRecords(string $tableName, int $uid) : int

Parameters

$tableName : string
$uid : int

Return values

int

getRelations()

Returns relation information for a record from a TCA table.

public getRelations(string $tableName, array $record, int $workspaceUid) : array

Parameters

$tableName : string
$record : array
$workspaceUid : int

Return values

array —

Array with information about relations

updateIndex()

Update full refindex. Used by 'referenceindex:update' CLI and ext:lowlevel BE UI.

public updateIndex(bool $testOnly[, ProgressListenerInterface|null $progressListener = null ]) : array

Parameters

$testOnly : bool
$progressListener : ProgressListenerInterface|null = null

If set, the current progress is added to the listener

Return values

array —

Header and body status content

updateRefIndexTable()

Update the sys_refindex table for a record, even one just deleted.

public updateRefIndexTable(string $tableName, int $uid[, bool $testOnly = false ][, int $workspaceUid = 0 ][, array|null $currentRecord = null ]) : array

This is used by DataHandler ReferenceIndexUpdater as entry method to take care of single records. It is also used internally via updateIndex() by CLI "referenceindex:update" and lowlevel BE module.

Parameters

$tableName : string
$uid : int
$testOnly : bool = false
$workspaceUid : int = 0
$currentRecord : array|null = null

Current full (select *) record from DB. Optimization for updateIndex().

Return values

array —

Statistics about how many index records were added, deleted and not altered.

On this page