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

Public Member Functions

 __construct (private readonly ConnectionPool $connectionPool)
 
 configure ()
 

Protected Member Functions

 execute (InputInterface $input, OutputInterface $output)
 
array findAllFlaggedRecordsInPage (int $pageId, int $depth, int $maximumTimestamp, array $deletedRecords=[])
 
 getTablesWithFlag (string $flag)
 
 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 38 of file DeletedRecordsCommand.php.

Constructor & Destructor Documentation

◆ __construct()

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

Definition at line 40 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 48 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)

Definition at line 302 of file DeletedRecordsCommand.php.

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

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

◆ execute()

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

◆ findAllFlaggedRecordsInPage()

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

Definition at line 149 of file DeletedRecordsCommand.php.

References TYPO3\CMS\Lowlevel\Command\DeletedRecordsCommand\getTablesWithFlag(), and TYPO3\CMS\Core\Database\Connection\PARAM_INT.

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

◆ getTablesWithFlag()

TYPO3\CMS\Lowlevel\Command\DeletedRecordsCommand::getTablesWithFlag ( string  $flag)
protected

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

Definition at line 284 of file DeletedRecordsCommand.php.

References $GLOBALS.

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