TYPO3CMS  8
 All Classes Namespaces Files Functions Variables Pages
OrphanRecordsCommand Class Reference
Inheritance diagram for OrphanRecordsCommand:

Public Member Functions

 configure ()
 

Protected Member Functions

 execute (InputInterface $input, OutputInterface $output)
 
 findAllConnectedRecordsInPage (int $pageId, int $depth, array $allRecords=[])
 
 deleteRecords (array $orphanedRecords, bool $dryRun, SymfonyStyle $io)
 
 getBackendUser ()
 

Detailed Description

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

Definition at line 33 of file OrphanRecordsCommand.php.

Member Function Documentation

configure ( )

Configure the command by defining the name, options and arguments

Definition at line 39 of file OrphanRecordsCommand.php.

deleteRecords ( array  $orphanedRecords,
bool  $dryRun,
SymfonyStyle  $io 
)
protected

Deletes records via DataHandler

Parameters
array$orphanedRecordstwo level array with tables and uids
bool$dryRuncheck if the records should NOT be deleted (use –dry-run to avoid)
SymfonyStyle$io
Returns
void

Definition at line 244 of file OrphanRecordsCommand.php.

References GeneralUtility\makeInstance().

Referenced by OrphanRecordsCommand\execute().

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
void

Definition at line 72 of file OrphanRecordsCommand.php.

References $GLOBALS, OrphanRecordsCommand\deleteRecords(), OrphanRecordsCommand\findAllConnectedRecordsInPage(), OrphanRecordsCommand\getBackendUser(), and GeneralUtility\makeInstance().

findAllConnectedRecordsInPage ( int  $pageId,
int  $depth,
array  $allRecords = [] 
)
protected

Recursive traversal of page tree to fetch all records marekd as "deleted", via option $GLOBALS[TCA][$tableName][ctrl][delete] This also takes deleted versioned records into account.

Parameters
int$pageIdthe uid of the pages record (can also be 0)
int$depthThe current depth of levels to go down
array$allRecordsthe records that are already marked as deleted (used when going recursive)
Returns
array the modified $deletedRecords array

Definition at line 157 of file OrphanRecordsCommand.php.

References $GLOBALS, GeneralUtility\makeInstance(), and BackendUtility\selectVersionsOfRecord().

Referenced by OrphanRecordsCommand\execute().

getBackendUser ( )
protected

Short-hand function for accessing the current backend user

Returns
BackendUserAuthentication

Definition at line 288 of file OrphanRecordsCommand.php.

References $GLOBALS.

Referenced by OrphanRecordsCommand\execute().