Handler
The Trash Handler interface defines operations on Location elements in the storage engine.
Methods¶
                 deleteTrashItem()
            ¶
deleteTrashItem()
            ¶
    
        Removes a trashed location identified by $trashedLocationId from trash Associated content has to be deleted.
|  |  | 
Parameters
| Name | Type | Default value | Description | 
|---|---|---|---|
| $trashedId | int | - | - | 
Return values
                 emptyTrash()
            ¶
emptyTrash()
            ¶
    
        Empties the trash Everything contained in the trash must be removed.
|  |  | 
Return values
                 findTrashItems()
            ¶
findTrashItems()
            ¶
    
        Returns all trashed locations satisfying the $criterion (if provided), sorted with $sort (if any).
|  |  | 
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
                 loadTrashItem()
            ¶
loadTrashItem()
            ¶
    
        Loads the data for the trashed location identified by $id.
|  |  | 
$id is the same as original location (which has been previously trashed).
Parameters
| Name | Type | Default value | Description | 
|---|---|---|---|
| $id | int | - | - | 
Return values
Tags
                 recover()
            ¶
recover()
            ¶
    
        Returns a trashed location to normal state.
|  |  | 
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
                 trashSubtree()
            ¶
trashSubtree()
            ¶
    
        Sends a subtree starting to $locationId to the trash and returns a Trashed object corresponding to $locationId.
|  |  | 
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