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
$limit  : string
String with the global limit
$runtimeCache  : FrontendInterface
$table  : array
Array with all available tables

Methods

__construct()  : mixed
deleteData()  : bool
Delete element from any table
getDeletedRows()  : array
getTotalCount()  : int
Find the total count of deleted records
loadData()  : self
Load all deleted rows from $table If table is not set, it iterates the TCA tables
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
resolveTree()  : array
setData()  : void
Set all deleted rows
setDeletedRows()  : void

Properties

$deletedRows

Array with all deleted rows

protected array $deletedRows = []

$limit

String with the global limit

protected string $limit = ''

$table

Array with all available tables

protected array $table = []

Methods

deleteData()

Delete element from any table

public deleteData(array|null $recordsArray) : bool

Parameters

$recordsArray : array|null

Representation of the records

Return values

bool

getDeletedRows()

public getDeletedRows() : array

Return values

array

getTotalCount()

Find the total count of deleted records

public getTotalCount(int $id, string $table, int $depth, string $filter) : int

Parameters

$id : int

UID from record

$table : string

Tablename from record

$depth : int

How many levels recursive

$filter : string

Filter text

Return values

int

loadData()

Load all deleted rows from $table If table is not set, it iterates the TCA tables

public loadData(int $id, string $table, int $depth[, string $limit = '' ][, string $filter = '' ]) : self

Parameters

$id : int

UID from selected page

$table : string

Tablename

$depth : int

How many levels recursive

$limit : string = ''

MySQL LIMIT

$filter : string = ''

Filter text

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

resolveTree()

protected resolveTree(int $id, int $depth, string $permsClause) : array

Parameters

$id : int
$depth : int
$permsClause : string

Return values

array

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

Parameters

$table : string
$row : array

Deleted record row

On this page