‪TYPO3CMS  10.4
TYPO3\CMS\Workspaces\Command\WorkspaceVersionRecordsCommand Class Reference
Inheritance diagram for TYPO3\CMS\Workspaces\Command\WorkspaceVersionRecordsCommand:

Public Member Functions

 configure ()
 

Protected Member Functions

int execute (InputInterface $input, OutputInterface $output)
 
 traversePageTreeForVersionedRecords (int $rootID, int $depth, bool $isInsideVersionedPage=false, bool $rootIsVersion=false)
 
array findUnusedPlaceholderRecords ()
 
array findInvalidMovePlaceholderRecords ()
 
array findInvalidMoveIdRecords ()
 
 deleteRecords (array $records, bool $dryRun, SymfonyStyle $io)
 
 resetRecordsWithoutValidWorkspace (array $records, bool $dryRun, SymfonyStyle $io)
 
 deleteUnusedPlaceholders (array $records, bool $dryRun, SymfonyStyle $io)
 
array loadAllWorkspaceRecords ()
 
array getAllVersionableTables ()
 

Protected Attributes

array $allWorkspaces = array( 0 => 'Live Workspace' )
 
array $foundRecords
 

Detailed Description

Fetches all versions in the database, and checks for integrity

Definition at line 37 of file WorkspaceVersionRecordsCommand.php.

Member Function Documentation

◆ configure()

TYPO3\CMS\Workspaces\Command\WorkspaceVersionRecordsCommand::configure ( )

Configuring the command options

Definition at line 67 of file WorkspaceVersionRecordsCommand.php.

◆ deleteRecords()

TYPO3\CMS\Workspaces\Command\WorkspaceVersionRecordsCommand::deleteRecords ( array  $records,
bool  $dryRun,
SymfonyStyle  $io 
)
protected

Deletes records via DataHandler

Parameters
array$records‪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 546 of file WorkspaceVersionRecordsCommand.php.

Referenced by TYPO3\CMS\Workspaces\Command\WorkspaceVersionRecordsCommand\execute().

◆ deleteUnusedPlaceholders()

TYPO3\CMS\Workspaces\Command\WorkspaceVersionRecordsCommand::deleteUnusedPlaceholders ( array  $records,
bool  $dryRun,
SymfonyStyle  $io 
)
protected

Delete unused placeholders

Parameters
array$records‪array with array of table and uid of each record
bool$dryRun‪check if the records should NOT be deleted (use –dry-run to avoid)
SymfonyStyle$io

Definition at line 629 of file WorkspaceVersionRecordsCommand.php.

Referenced by TYPO3\CMS\Workspaces\Command\WorkspaceVersionRecordsCommand\execute().

◆ execute()

◆ findInvalidMoveIdRecords()

array TYPO3\CMS\Workspaces\Command\WorkspaceVersionRecordsCommand::findInvalidMoveIdRecords ( )
protected

Find records with a t3ver_move_id field != 0 that are neither a move placeholder or, if it is a move placeholder is offline

Returns
‪array

Definition at line 499 of file WorkspaceVersionRecordsCommand.php.

References TYPO3\CMS\Core\Type\Enumeration\cast(), TYPO3\CMS\Workspaces\Command\WorkspaceVersionRecordsCommand\getAllVersionableTables(), and TYPO3\CMS\Core\Versioning\VersionState\MOVE_PLACEHOLDER.

Referenced by TYPO3\CMS\Workspaces\Command\WorkspaceVersionRecordsCommand\execute().

◆ findInvalidMovePlaceholderRecords()

array TYPO3\CMS\Workspaces\Command\WorkspaceVersionRecordsCommand::findInvalidMovePlaceholderRecords ( )
protected

◆ findUnusedPlaceholderRecords()

array TYPO3\CMS\Workspaces\Command\WorkspaceVersionRecordsCommand::findUnusedPlaceholderRecords ( )
protected

◆ getAllVersionableTables()

◆ loadAllWorkspaceRecords()

array TYPO3\CMS\Workspaces\Command\WorkspaceVersionRecordsCommand::loadAllWorkspaceRecords ( )
protected

HELPER FUNCTIONS Fetches all sys_workspace records from the database

Returns
‪array all workspaces with UID as key, and the title as value

Definition at line 661 of file WorkspaceVersionRecordsCommand.php.

References TYPO3\CMS\Workspaces\Command\WorkspaceVersionRecordsCommand\$allWorkspaces.

Referenced by TYPO3\CMS\Workspaces\Command\WorkspaceVersionRecordsCommand\execute().

◆ resetRecordsWithoutValidWorkspace()

TYPO3\CMS\Workspaces\Command\WorkspaceVersionRecordsCommand::resetRecordsWithoutValidWorkspace ( array  $records,
bool  $dryRun,
SymfonyStyle  $io 
)
protected

Set the workspace ID to "0" (= live) for records that have a workspace not found in the system (e.g. hard deleted in the database)

Parameters
array$records‪array with array of table and uid of each record
bool$dryRun‪check if the records should NOT be deleted (use –dry-run to avoid)
SymfonyStyle$io

Definition at line 590 of file WorkspaceVersionRecordsCommand.php.

Referenced by TYPO3\CMS\Workspaces\Command\WorkspaceVersionRecordsCommand\execute().

◆ traversePageTreeForVersionedRecords()

TYPO3\CMS\Workspaces\Command\WorkspaceVersionRecordsCommand::traversePageTreeForVersionedRecords ( int  $rootID,
int  $depth,
bool  $isInsideVersionedPage = false,
bool  $rootIsVersion = false 
)
protected

Recursive traversal of page tree, fetching ALL versioned records found in the database

Parameters
int$rootID‪Page root id (must be online, valid page record - or zero for page tree root)
int$depth‪Depth
bool$isInsideVersionedPage‪DON'T set from outside, internal. (indicates we are inside a version of a page)
bool$rootIsVersion‪DON'T set from outside, internal. Indicates that rootID is a version of a page

Definition at line 270 of file WorkspaceVersionRecordsCommand.php.

References $GLOBALS, TYPO3\CMS\Workspaces\Command\WorkspaceVersionRecordsCommand\getAllVersionableTables(), and TYPO3\CMS\Backend\Utility\BackendUtility\selectVersionsOfRecord().

Referenced by TYPO3\CMS\Workspaces\Command\WorkspaceVersionRecordsCommand\execute().

Member Data Documentation

◆ $allWorkspaces

array TYPO3\CMS\Workspaces\Command\WorkspaceVersionRecordsCommand::$allWorkspaces = array( 0 => 'Live Workspace' )
protected

◆ $foundRecords

array TYPO3\CMS\Workspaces\Command\WorkspaceVersionRecordsCommand::$foundRecords
protected
Initial value:
= array(
'all_versioned_records' => [],
'published_versions' => [],
'versions_in_live' => [],
'invalid_workspace' => []
)

Array with all records found when traversing the database

Definition at line 48 of file WorkspaceVersionRecordsCommand.php.