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

Public Member Functions

 __construct (private readonly ConnectionPool $connectionPool)
 
 configure ()
 

Protected Member Functions

 execute (InputInterface $input, OutputInterface $output)
 
 traversePageTreeForVersionedRecords (int $rootID, int $depth, bool $isInsideVersionedPage=false, bool $rootIsVersion=false)
 
 deleteRecords (array $records, bool $dryRun, SymfonyStyle $io)
 
 resetRecordsWithoutValidWorkspace (array $records, bool $dryRun, SymfonyStyle $io)
 
array loadAllWorkspaceRecords ()
 
 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 41 of file WorkspaceVersionRecordsCommand.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Workspaces\Command\WorkspaceVersionRecordsCommand::__construct ( private readonly ConnectionPool  $connectionPool)

Definition at line 48 of file WorkspaceVersionRecordsCommand.php.

Member Function Documentation

◆ configure()

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

Configuring the command options

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

Definition at line 361 of file WorkspaceVersionRecordsCommand.php.

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

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

◆ execute()

◆ getAllVersionableTables()

TYPO3\CMS\Workspaces\Command\WorkspaceVersionRecordsCommand::getAllVersionableTables ( )
protected

Returns all TCA tables where workspaces is enabled

Definition at line 468 of file WorkspaceVersionRecordsCommand.php.

References $GLOBALS.

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

◆ 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 445 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)

Definition at line 404 of file WorkspaceVersionRecordsCommand.php.

References TYPO3\CMS\Webhooks\Message\$uid, and TYPO3\CMS\Core\Database\Connection\PARAM_INT.

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 241 of file WorkspaceVersionRecordsCommand.php.

References $GLOBALS, TYPO3\CMS\Workspaces\Command\WorkspaceVersionRecordsCommand\getAllVersionableTables(), and TYPO3\CMS\Core\Database\Connection\PARAM_INT.

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 56 of file WorkspaceVersionRecordsCommand.php.