TrashService
Trash service, used for managing trashed content.
Methods¶
deleteTrashItem() ¶
Deletes a trash item.
|
|
The corresponding content object will be removed
Parameters
Name | Type | Default value | Description |
---|---|---|---|
$trashItem | TrashItem | - | - |
Return values
Tags
emptyTrash() ¶
Empties trash.
|
|
All locations contained in the trash will be removed. Content objects will be removed if all locations of the content are gone.
Return values
Tags
findTrashItems() ¶
Returns a collection of Trashed locations contained in the trash, which are readable by the current user.
|
|
$query allows to filter/sort the elements to be contained in the collection.
Parameters
Name | Type | Default value | Description |
---|---|---|---|
$query | Query | - | - |
Return values
loadTrashItem() ¶
Loads a trashed location object from its $id.
|
|
Note that $id is identical to original location, which has been previously trashed
Parameters
Name | Type | Default value | Description |
---|---|---|---|
$trashItemId | int | - | - |
Return values
Tags
recover() ¶
Recovers the $trashedLocation at its original place if possible.
If $newParentLocation is provided, $trashedLocation will be restored under it.
Parameters
Name | Type | Default value | Description |
---|---|---|---|
$trashItem | TrashItem | - | - |
$newParentLocation | Location | null | - |
Return values
the newly created or recovered location
Tags
trash() ¶
Sends $location and all its children to trash and returns the corresponding trash item.
The current user may not have access to the returned trash item, check before using it. Content is left untouched.
Parameters
Name | Type | Default value | Description |
---|---|---|---|
$location | Location | - | - |
Return values
TrashItem|null
null if location was deleted, otherwise TrashItem