ReferenceIndex

Reference index processing and relation extraction.

Internal

Extensions shouldn't fiddle with the reference index themselves, it's task of DataHandler to do this.

Attributes
#[Autoconfigure]
$public: true

Table of Contents

Methods

__construct()  : mixed
getNumberOfReferencedRecords()  : int
Returns the amount of references for the given record.
getRelations()  : array<string|int, mixed>
Returns relation information for a record from a TCA table.
updateIndex()  : array<string|int, mixed>
Update full refindex. Used by 'referenceindex:update' CLI and ext:lowlevel BE UI.
updateRefIndexTable()  : array<string|int, mixed>
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<string|int, mixed> $record, int $workspaceUid) : array<string|int, mixed>
Parameters
$tableName : string
$record : array<string|int, mixed>
$workspaceUid : int
Internal
Return values
array<string|int, mixed>

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<string|int, mixed>
Parameters
$testOnly : bool
$progressListener : ProgressListenerInterface|null = null

If set, the current progress is added to the listener

Internal
Return values
array<string|int, mixed>

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<string|int, mixed>|null $currentRecord = null ]) : array<string|int, mixed>

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<string|int, mixed>|null = null

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

Internal
Return values
array<string|int, mixed>

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


        
On this page

Search results