DeletedRecords
Each GeneralUtility::makeInstance() call must return a fresh DeletedRecords instance so that loadData() and getTotalCount() in the controller do not accumulate state across calls.
This class is a specific domain model implementation and is not part of the Public TYPO3 API.
Attributes
- #[Autoconfigure]
- $public: true
- $shared: false
Table of Contents
Properties
- $deletedRows : array<string|int, mixed>
- Array with all deleted rows
- $runtimeCache : FrontendInterface
Methods
- __construct() : mixed
- deleteData() : int
- Delete element from any table
- getDeletedRows() : array<string|int, mixed>
- loadData() : self
- Load all deleted rows from $table.
- undeleteData() : bool|int
- Undelete records If $recursive is TRUE all records below the page uid would be undelete too
- checkAccess() : bool
- Checks the page access rights (Code for access check mostly taken from FormEngine) as well as the table access rights of the user.
- checkRecordAccess() : void
- Checks whether the current backend user has access to the given records.
- getBackendUser() : BackendUserAuthentication
- getDeletedParentPages() : array<string|int, mixed>
- Returns deleted parent pages
- getFilteredQueryBuilder() : QueryBuilder
- Helper method for setData() to create a QueryBuilder that filters the records by default.
- getPidOfUid() : int
- Get pid of uid
- getRelevantSchemata() : array<string|int, TcaSchema>
- Returns the modifiable tables of the current user, which have a SoftDelete field.
- getTreeList() : array<string|int, mixed>
- resolveTree() : array<string|int, mixed>
- setData() : void
- Set all deleted rows
- setDeletedRows() : void
Properties
$deletedRows
Array with all deleted rows
protected
array<string|int, mixed>
$deletedRows
= []
$runtimeCache read-only
protected
FrontendInterface
$runtimeCache
Attributes
- #[Autowire]
- $service: 'cache.runtime'
Methods
__construct()
public
__construct(TcaSchemaFactory $tcaSchemaFactory, FrontendInterface $runtimeCache) : mixed
Parameters
- $tcaSchemaFactory : TcaSchemaFactory
- $runtimeCache : FrontendInterface
deleteData()
Delete element from any table
public
deleteData(array<int, string> $recordsArray) : int
Parameters
- $recordsArray : array<int, string>
-
Representation of the records as "table:uid" strings
Return values
int —Number of records successfully deleted
getDeletedRows()
public
getDeletedRows() : array<string|int, mixed>
Return values
array<string|int, mixed>loadData()
Load all deleted rows from $table.
public
loadData(int $id, string $table, int $depth[, string $filter = '' ]) : self
If table is not set, it iterates the TCA tables.
Parameters
- $id : int
-
UID from selected page
- $table : string
-
Tablename
- $depth : int
-
How many levels recursive
- $filter : string = ''
-
Filter text
Return values
selfundeleteData()
Undelete records If $recursive is TRUE all records below the page uid would be undelete too
public
undeleteData(array<string|int, mixed> $recordsArray[, bool $recursive = false ]) : bool|int
Parameters
- $recordsArray : array<string|int, mixed>
-
Representation of the records
- $recursive : bool = false
-
Whether to recursively undelete
Return values
bool|intcheckAccess()
Checks the page access rights (Code for access check mostly taken from FormEngine) as well as the table access rights of the user.
protected
checkAccess(string $table, array<string|int, mixed> $row) : bool
Parameters
- $table : string
-
The table to check access for
- $row : array<string|int, mixed>
-
Record array
Return values
bool —Returns TRUE is the user has access, or FALSE if not
checkRecordAccess()
Checks whether the current backend user has access to the given records.
protected
checkRecordAccess(string $table, array<string|int, mixed> $rows) : void
Parameters
- $table : string
-
Name of the table
- $rows : array<string|int, mixed>
-
Record row
getBackendUser()
protected
getBackendUser() : BackendUserAuthentication
Return values
BackendUserAuthenticationgetDeletedParentPages()
Returns deleted parent pages
protected
getDeletedParentPages(int $uid[, array<string|int, mixed> &$pages = [] ]) : array<string|int, mixed>
Parameters
- $uid : int
- $pages : array<string|int, mixed> = []
Return values
array<string|int, mixed>getFilteredQueryBuilder()
Helper method for setData() to create a QueryBuilder that filters the records by default.
protected
getFilteredQueryBuilder(TcaSchema $schema, int $pid, int $depth, string $filter) : QueryBuilder
Parameters
- $schema : TcaSchema
- $pid : int
- $depth : int
- $filter : string
Return values
QueryBuildergetPidOfUid()
Get pid of uid
protected
getPidOfUid(int $uid, string $table) : int
Parameters
- $uid : int
- $table : string
Return values
intgetRelevantSchemata()
Returns the modifiable tables of the current user, which have a SoftDelete field.
protected
getRelevantSchemata() : array<string|int, TcaSchema>
Return values
array<string|int, TcaSchema>getTreeList()
protected
getTreeList(int $id, int $depth) : array<string|int, mixed>
Parameters
- $id : int
- $depth : int
Return values
array<string|int, mixed>resolveTree()
protected
resolveTree(int $id, int $depth, string $permsClause) : array<string|int, mixed>
Parameters
- $id : int
- $depth : int
- $permsClause : string
Return values
array<string|int, mixed>setData()
Set all deleted rows
protected
setData(int $id, TcaSchema $schema, int $depth, string $filter) : void
Parameters
- $id : int
-
UID from record
- $schema : TcaSchema
- $depth : int
-
How many levels recursive
- $filter : string
-
Filter text
setDeletedRows()
protected
setDeletedRows(string $table, array<string|int, mixed> $row) : void
Parameters
- $table : string
- $row : array<string|int, mixed>
-
Deleted record row