‪TYPO3CMS  ‪main
TYPO3\CMS\Lowlevel\Command\OrphanRecordsCommand Class Reference
Inheritance diagram for TYPO3\CMS\Lowlevel\Command\OrphanRecordsCommand:

Public Member Functions

 __construct (private readonly ConnectionPool $connectionPool)
 
 configure ()
 

Protected Member Functions

 execute (InputInterface $input, OutputInterface $output)
 
array findAllConnectedRecordsInPage (int $pageId, int $depth, array $allRecords=[])
 
 deleteRecords (array $orphanedRecords, bool $dryRun, SymfonyStyle $io)
 

Detailed Description

Finds (and fixes) all records that have an invalid / deleted page ID

Definition at line 37 of file OrphanRecordsCommand.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Lowlevel\Command\OrphanRecordsCommand::__construct ( private readonly ConnectionPool  $connectionPool)

Definition at line 39 of file OrphanRecordsCommand.php.

Member Function Documentation

◆ configure()

TYPO3\CMS\Lowlevel\Command\OrphanRecordsCommand::configure ( )

Configure the command by defining the name, options and arguments

Definition at line 47 of file OrphanRecordsCommand.php.

◆ deleteRecords()

TYPO3\CMS\Lowlevel\Command\OrphanRecordsCommand::deleteRecords ( array  $orphanedRecords,
bool  $dryRun,
SymfonyStyle  $io 
)
protected

Deletes records via DataHandler

Parameters
array$orphanedRecords‪two level array with tables and uids
bool$dryRun‪check if the records should NOT be deleted (use –dry-run to avoid)

Definition at line 239 of file OrphanRecordsCommand.php.

References TYPO3\CMS\Webhooks\Message\$uid.

Referenced by TYPO3\CMS\Lowlevel\Command\OrphanRecordsCommand\execute().

◆ execute()

TYPO3\CMS\Lowlevel\Command\OrphanRecordsCommand::execute ( InputInterface  $input,
OutputInterface  $output 
)
protected

◆ findAllConnectedRecordsInPage()

array TYPO3\CMS\Lowlevel\Command\OrphanRecordsCommand::findAllConnectedRecordsInPage ( int  $pageId,
int  $depth,
array  $allRecords = [] 
)
protected

Recursive traversal of page tree to fetch all records marked as "deleted", via option $GLOBALS[TCA][$tableName][ctrl][delete] This also takes deleted versioned records into account.

Parameters
int$pageId‪the uid of the pages record (can also be 0)
int$depth‪The current depth of levels to go down
array$allRecords‪the records that are already marked as deleted (used when going recursive)
Returns
‪array the modified $deletedRecords array

Definition at line 153 of file OrphanRecordsCommand.php.

References $GLOBALS, and TYPO3\CMS\Core\Database\Connection\PARAM_INT.

Referenced by TYPO3\CMS\Lowlevel\Command\OrphanRecordsCommand\execute().