DeletedRecordsCommand

class \TYPO3\CMS\Lowlevel\Command\DeletedRecordsCommand

Extends
Command

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

Table of Contents

Methods

__construct()  : mixed
configure()  : mixed
Configure the command by defining the name, options and arguments
deleteRecords()  : mixed
Deletes records via DataHandler
execute()  : int
Executes the command to find and permanently delete records which are marked as deleted
findAllFlaggedRecordsInPage()  : array
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.
getTablesWithDeletedFlags()  : array
Fetches all tables registered in the TCA with a deleted and that are not pages (which are handled separately)

Methods

configure()

Configure the command by defining the name, options and arguments

public configure() : mixed

deleteRecords()

Deletes records via DataHandler

protected deleteRecords(array $deletedRecords, bool $dryRun, SymfonyStyle $io) : mixed

Parameters

$deletedRecords : array

two level array with tables and uids

$dryRun : bool

check if the records should NOT be deleted (use --dry-run to avoid)

$io : SymfonyStyle

execute()

Executes the command to find and permanently delete records which are marked as deleted

protected execute(InputInterface $input, OutputInterface $output) : int

Parameters

$input : InputInterface
$output : OutputInterface

Return values

int

findAllFlaggedRecordsInPage()

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.

protected findAllFlaggedRecordsInPage(int $pageId, int $depth[, array $deletedRecords = [] ]) : array

Parameters

$pageId : int

the uid of the pages record (can also be 0)

$depth : int

The current depth of levels to go down

$deletedRecords : array = []

the records that are already marked as deleted (used when going recursive)

Return values

array —

the modified $deletedRecords array

getTablesWithDeletedFlags()

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

protected getTablesWithDeletedFlags() : array

Return values

array —

an associative array with the table as key and the

On this page