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

Public Member Functions

 __construct (ConnectionPool $connectionPool)
 
 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)
 

Private Attributes

ConnectionPool $connectionPool
 

Detailed Description

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

Definition at line 35 of file OrphanRecordsCommand.php.

Constructor & Destructor Documentation

◆ __construct()

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

Member Function Documentation

◆ configure()

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

Configure the command by defining the name, options and arguments

Definition at line 49 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 247 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 80 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 160 of file OrphanRecordsCommand.php.

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

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

Member Data Documentation

◆ $connectionPool

ConnectionPool TYPO3\CMS\Lowlevel\Command\OrphanRecordsCommand::$connectionPool
private