Exponential 5.x Kernel 7.5.40 Exponential New Stack (Symfony-based) Kernel — PHP Class Reference

Public Member Functions | List of all members
eZ\Publish\API\Repository\TrashService Interface Reference

Trash service, used for managing trashed content. More...

Inheritance diagram for eZ\Publish\API\Repository\TrashService:

## Public Member Functions
| loadTrashItem ($trashItemId)
| Loads a trashed location object from its $id. More...
| trash (Location $location)
| Sends $location and all its children to trash and returns the corresponding trash item. More...
| recover (TrashItem $trashItem, Location $newParentLocation=null)
| Recovers the $trashedLocation at its original place if possible. More...
| emptyTrash ()
| Empties trash. More...
| deleteTrashItem (TrashItem $trashItem)
| Deletes a trash item. More...
| findTrashItems (Query $query)
| Returns a collection of Trashed locations contained in the trash, which are readable by the current user. More...

## Detailed Description

Trash service, used for managing trashed content.

Definition at line 16 of file API/Repository/TrashService.php.

## Member Function Documentation

## ◆ deleteTrashItem()

eZ\Publish\API\Repository\TrashService::deleteTrashItem | ( | TrashItem | $trashItem | ) |

Deletes a trash item.

The corresponding content object will be removed

Exceptions

Implemented in eZ\Publish\Core\SignalSlot\TrashService, and eZ\Publish\Core\Repository\SiteAccessAware\TrashService.

## ◆ emptyTrash()

eZ\Publish\API\Repository\TrashService::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.

Exceptions

Implemented in eZ\Publish\Core\SignalSlot\TrashService, eZ\Publish\Core\REST\Client\TrashService, eZ\Publish\Core\Repository\TrashService, and eZ\Publish\Core\Repository\SiteAccessAware\TrashService.

## ◆ findTrashItems()

eZ\Publish\API\Repository\TrashService::findTrashItems | ( | Query | $query | ) |

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

  \eZ\Publish\API\Repository\Values\Content\Query | $query |

Returns
  \eZ\Publish\API\Repository\Values\Content\Trash\SearchResult

Implemented in eZ\Publish\Core\SignalSlot\TrashService, eZ\Publish\Core\REST\Client\TrashService, eZ\Publish\Core\Repository\TrashService, and eZ\Publish\Core\Repository\SiteAccessAware\TrashService.

## ◆ loadTrashItem()

eZ\Publish\API\Repository\TrashService::loadTrashItem | ( |  | $trashItemId | ) |

Loads a trashed location object from its $id.

Note that $id is identical to original location, which has been previously trashed

Exceptions

Implemented in eZ\Publish\Core\SignalSlot\TrashService, eZ\Publish\Core\REST\Client\TrashService, eZ\Publish\Core\Repository\TrashService, and eZ\Publish\Core\Repository\SiteAccessAware\TrashService.

## ◆ recover()

eZ\Publish\API\Repository\TrashService::recover | ( | TrashItem | $trashItem,
|  | Location | $newParentLocation = `null`
| ) |  |

Recovers the $trashedLocation at its original place if possible.

Exceptions

Implemented in eZ\Publish\Core\SignalSlot\TrashService, and eZ\Publish\Core\Repository\SiteAccessAware\TrashService.

## ◆ trash()

eZ\Publish\API\Repository\TrashService::trash | ( | Location | $location | ) |

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.

Exceptions

Implemented in eZ\Publish\Core\SignalSlot\TrashService, eZ\Publish\Core\REST\Client\TrashService, eZ\Publish\Core\Repository\TrashService, and eZ\Publish\Core\Repository\SiteAccessAware\TrashService.

The documentation for this interface was generated from the following file:

- API/Repository/TrashService.php

Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.