DatabaseIntegrityCheck
This class holds functions used by the TYPO3 backend to check the integrity of the database (The DBint module, 'lowlevel' extension)
Depends on \TYPO3\CMS\Core\Database\RelationHandler
Tags
Attributes
- #[Autoconfigure]
- $public: true
Table of Contents
Properties
- $lostPagesList : string
- $lRecords : array<string|int, mixed>
- $pageIdArray : array<string|int, mixed>
- $pageTranslatedPageIDArray : array<string|int, mixed>
- $recStats : array<string|int, mixed>
- $tcaSchemaFactory : TcaSchemaFactory
Methods
- __construct() : mixed
- countRecords() : array<string|int, mixed>
- Counts records from $GLOBALS['TCA']-tables that ARE attached to an existing page.
- fixLostRecord() : bool
- Fixes lost record from $table with uid $uid by setting the PID to zero.
- genTree() : mixed
- Generates a list of Page-uid's that corresponds to the tables in the tree.
- getLostPagesList() : string
- getLRecords() : array<string|int, mixed>
- getPageIdArray() : array<string|int, mixed>
- getPageTranslatedPageIDArray() : array<string|int, mixed>
- getRecStats() : array<string|int, mixed>
- lostRecords() : void
- Fills $this->lRecords with the records from all tc-tables that are not attached to a PID in the pid-list.
Properties
$lostPagesList
protected
string
$lostPagesList
= ''
$lRecords
protected
array<string|int, mixed>
$lRecords
= []
$pageIdArray
protected
array<string|int, mixed>
$pageIdArray
= []
Will hold id/rec pairs from genTree()
$pageTranslatedPageIDArray
protected
array<string|int, mixed>
$pageTranslatedPageIDArray
= []
Will hold id/rec pairs from genTree() that are not default language
$recStats
protected
array<string|int, mixed>
$recStats
= ['all_valid' => [], 'published_versions' => [], 'deleted' => []]
Statistics
$tcaSchemaFactory read-only
protected
TcaSchemaFactory
$tcaSchemaFactory
Methods
__construct()
public
__construct(TcaSchemaFactory $tcaSchemaFactory) : mixed
Parameters
- $tcaSchemaFactory : TcaSchemaFactory
countRecords()
Counts records from $GLOBALS['TCA']-tables that ARE attached to an existing page.
public
countRecords(string $pid_list) : array<string|int, mixed>
Parameters
- $pid_list : string
-
list of pid's (page-record uid's). This list is probably made by genTree()
Return values
array<string|int, mixed> —an array with the number of records from all $GLOBALS['TCA']-tables that are attached to a PID in the pid-list.
fixLostRecord()
Fixes lost record from $table with uid $uid by setting the PID to zero.
public
fixLostRecord(string $table, int $uid) : bool
If there is a disabled column for the record that will be set as well.
Parameters
- $table : string
-
Database tablename
- $uid : int
-
The uid of the record which will have the PID value set to 0 (zero)
Return values
bool —TRUE if done.
genTree()
Generates a list of Page-uid's that corresponds to the tables in the tree.
public
genTree(int $theID[, bool $versions = false ]) : mixed
This list should ideally include all records in the pages-table.
Parameters
- $theID : int
-
a pid (page-record id) from which to start making the tree
- $versions : bool = false
-
Internal variable, don't set from outside!
getLostPagesList()
public
getLostPagesList() : string
Return values
stringgetLRecords()
public
getLRecords() : array<string|int, mixed>
Return values
array<string|int, mixed>getPageIdArray()
public
getPageIdArray() : array<string|int, mixed>
Return values
array<string|int, mixed>getPageTranslatedPageIDArray()
public
getPageTranslatedPageIDArray() : array<string|int, mixed>
Return values
array<string|int, mixed>getRecStats()
public
getRecStats() : array<string|int, mixed>
Return values
array<string|int, mixed>lostRecords()
Fills $this->lRecords with the records from all tc-tables that are not attached to a PID in the pid-list.
public
lostRecords(string $pid_list) : void
Parameters
- $pid_list : string
-
list of pid's (page-record uid's). This list is probably made by genTree()