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

Public Member Functions

 configure ()
 

Protected Member Functions

int 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 34 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 40 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)
SymfonyStyle$io

Definition at line 239 of file OrphanRecordsCommand.php.

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

◆ execute()

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

Executes the command to find records not attached to the pagetree and permanently delete these records

Parameters
InputInterface$input
OutputInterface$output
Returns
‪int

Definition at line 72 of file OrphanRecordsCommand.php.

References $GLOBALS, $output, TYPO3\CMS\Lowlevel\Command\OrphanRecordsCommand\deleteRecords(), TYPO3\CMS\Lowlevel\Command\OrphanRecordsCommand\findAllConnectedRecordsInPage(), and TYPO3\CMS\Core\Core\Bootstrap\initializeBackendAuthentication().

◆ 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 152 of file OrphanRecordsCommand.php.

References $GLOBALS, and TYPO3\CMS\Backend\Utility\BackendUtility\selectVersionsOfRecord().

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