DeletedRecords

class \TYPO3\CMS\Recycler\Domain\Model\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.

Attributes

#[Autoconfigure]
$public: true
$shared: false

Table of Contents

Properties

$deletedRows  : array
Array with all deleted rows
$runtimeCache  : FrontendInterface

Methods

__construct()  : mixed
deleteData()  : int
Delete element from any table
getDeletedRows()  : array
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
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()  : TcaSchema[]
Returns the modifiable tables of the current user, which have a SoftDelete field.
getTreeList()  : array
setData()  : void
Set all deleted rows
setDeletedRows()  : void

Properties

$deletedRows

Array with all deleted rows

protected array $deletedRows = []

Methods

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

Return values

array

loadData()

Load all deleted rows from $table.

public loadData(int $id, string $table, int $depth[, string $filter = '' ][, int|null $languageId = null ]) : 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

$languageId : int|null = null

Restrict language aware records to this (site) language, records valid in all languages are always included. Null yields all records.

Return values

self

undeleteData()

Undelete records If $recursive is TRUE all records below the page uid would be undelete too

public undeleteData(array $recordsArray[, bool $recursive = false ]) : bool|int

Parameters

$recordsArray : array

Representation of the records

$recursive : bool = false

Whether to recursively undelete

Return values

bool|int

checkAccess()

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 $row) : bool

Parameters

$table : string

The table to check access for

$row : array

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 $rows) : void

Parameters

$table : string

Name of the table

$rows : array

Record row

getDeletedParentPages()

Returns deleted parent pages

protected getDeletedParentPages(int $uid[, array &$pages = [] ]) : array

Parameters

$uid : int
$pages : array = []

Return values

array

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

QueryBuilder

getPidOfUid()

Get pid of uid

protected getPidOfUid(int $uid, string $table) : int

Parameters

$uid : int
$table : string

Return values

int

getRelevantSchemata()

Returns the modifiable tables of the current user, which have a SoftDelete field.

protected getRelevantSchemata() : TcaSchema[]

Return values

TcaSchema[]

getTreeList()

protected getTreeList(int $id, int $depth) : array

Parameters

$id : int
$depth : int

Return values

array

setData()

Set all deleted rows

protected setData(int $id, TcaSchema $schema, int $depth, string $filter[, int|null $languageId = null ]) : void

Parameters

$id : int

UID from record

$schema : TcaSchema
$depth : int

How many levels recursive

$filter : string

Filter text

$languageId : int|null = null

Restrict language aware records to this (site) language, records valid in all languages are always included. Null yields all records.

setDeletedRows()

protected setDeletedRows(string $table, array $row) : void

Parameters

$table : string
$row : array

Deleted record row

On this page