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

Public Member Functions

 configure ()
 

Protected Member Functions

int execute (InputInterface $input, OutputInterface $output)
 
array findAllFlaggedRecordsInPage (int $pageId, int $depth, array $deletedRecords=[])
 
array getTablesWithDeletedFlags ()
 
 deleteRecords (array $deletedRecords, bool $dryRun, SymfonyStyle $io)
 

Detailed Description

Force-deletes all records in the database which have a deleted=1 flag

Definition at line 36 of file DeletedRecordsCommand.php.

Member Function Documentation

◆ configure()

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

Configure the command by defining the name, options and arguments

Definition at line 42 of file DeletedRecordsCommand.php.

◆ deleteRecords()

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

Deletes records via DataHandler

Parameters
array$deletedRecords‪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 274 of file DeletedRecordsCommand.php.

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

◆ execute()

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

◆ findAllFlaggedRecordsInPage()

array TYPO3\CMS\Lowlevel\Command\DeletedRecordsCommand::findAllFlaggedRecordsInPage ( int  $pageId,
int  $depth,
array  $deletedRecords = [] 
)
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$deletedRecords‪the records that are already marked as deleted (used when going recursive)
Returns
‪array the modified $deletedRecords array

Definition at line 135 of file DeletedRecordsCommand.php.

References TYPO3\CMS\Lowlevel\Command\DeletedRecordsCommand\execute(), TYPO3\CMS\Lowlevel\Command\DeletedRecordsCommand\getTablesWithDeletedFlags(), and TYPO3\CMS\Backend\Utility\BackendUtility\selectVersionsOfRecord().

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

◆ getTablesWithDeletedFlags()

array TYPO3\CMS\Lowlevel\Command\DeletedRecordsCommand::getTablesWithDeletedFlags ( )
protected

Fetches all tables registered in the TCA with a deleted and that are not pages (which are handled separately)

Returns
‪array an associative array with the table as key and the

Definition at line 255 of file DeletedRecordsCommand.php.

References $GLOBALS.

Referenced by TYPO3\CMS\Lowlevel\Command\DeletedRecordsCommand\findAllFlaggedRecordsInPage().