Copied!

Handler

Handler.php : 14

The Trash Handler interface defines operations on Location elements in the storage engine.

Methods

publicdeleteTrashItem()

Handler.php : 92

Removes a trashed location identified by $trashedLocationId from trash Associated content has to be deleted.

public deleteTrashItem(int $trashedId) : TrashItemDeleteResult

Parameters

Name Type Default value Description
$trashedId int - -

Return values

TrashItemDeleteResult

publicemptyTrash()

Handler.php : 82

Empties the trash Everything contained in the trash must be removed.

public emptyTrash() : TrashItemDeleteResultList

Return values

TrashItemDeleteResultList

publicfindTrashItems()

Handler.php : 74

Returns all trashed locations satisfying the $criterion (if provided), sorted with $sort (if any).

public findTrashItems([Criterion|null $criterion = null ][, int $offset = 0 ][, int $limit = null ][, array<string|int, SortClause$sort = null ]) : array<string|int, Trashed>|TrashResult

If no criterion is provided (null), no filter is applied.

TrashResult->totalCount will ignore limit and offset and representing the total amount of trashed items matching the criterion.

Parameters

Name Type Default value Description
$criterion Criterion|null null -
$offset int 0

Offset to start listing from, 0 by default

$limit int null

Limit for the listing. Null by default (no limit)

$sort array<string|int, SortClause> null -

Return values

array<string|int, Trashed>|TrashResult

publicloadTrashItem()

Handler.php : 26

Loads the data for the trashed location identified by $id.

public loadTrashItem(int $id) : Trashed

$id is the same as original location (which has been previously trashed).

Parameters

Name Type Default value Description
$id int - -

Return values

Trashed

Tags
Throws
NotFoundException

publicrecover()

Handler.php : 57

Returns a trashed location to normal state.

public recover(mixed $trashedId, mixed $newParentId) : int

Recreates the originally trashed location in the new position. If this is not possible (because the old location does not exist any more), a ParentNotFound exception is thrown.

Returns newly restored location Id.

Parameters

Name Type Default value Description
$trashedId mixed - -
$newParentId mixed - -

Return values

int

Newly restored location id

Tags
Throws
NotFoundException

If $newParentId is invalid

publictrashSubtree()

Handler.php : 39

Sends a subtree starting to $locationId to the trash and returns a Trashed object corresponding to $locationId.

public trashSubtree(mixed $locationId) : Trashed|null

Moves all locations in the subtree to the Trash. The associated content objects are left untouched.

Parameters

Name Type Default value Description
$locationId mixed - -

Return values

Trashed|null

null if location was deleted, otherwise Trashed object