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

Public Member Functions | Protected Attributes | List of all members
eZ\Publish\Core\Repository\SiteAccessAware\TrashService Class Reference

TrashService for SiteAccessAware layer. More...

Inheritance diagram for eZ\Publish\Core\Repository\SiteAccessAware\TrashService:

## Public Member Functions
| __construct (TrashServiceInterface $service)
| Construct service object from aggregated service. More...
| 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...

## Protected Attributes
| $service

## Detailed Description

TrashService for SiteAccessAware layer.

Currently does nothing but hand over calls to aggregated service.

Definition at line 19 of file Core/Repository/SiteAccessAware/TrashService.php.

## Constructor & Destructor Documentation

## ◆ __construct()

eZ\Publish\Core\Repository\SiteAccessAware\TrashService::__construct | ( | TrashServiceInterface | $service | ) |

Construct service object from aggregated service.

Parameters

  \eZ\Publish\API\Repository\TrashService | $service |

Definition at line 29 of file Core/Repository/SiteAccessAware/TrashService.php.

References eZ\Publish\Core\Repository\SiteAccessAware\TrashService\$service.

## Member Function Documentation

## ◆ deleteTrashItem()

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

Deletes a trash item.

The corresponding content object will be removed

Exceptions

Implements eZ\Publish\API\Repository\TrashService.

Definition at line 55 of file Core/Repository/SiteAccessAware/TrashService.php.

## ◆ emptyTrash()

eZ\Publish\Core\Repository\SiteAccessAware\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

Implements eZ\Publish\API\Repository\TrashService.

Definition at line 50 of file Core/Repository/SiteAccessAware/TrashService.php.

## ◆ findTrashItems()

eZ\Publish\Core\Repository\SiteAccessAware\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

Implements eZ\Publish\API\Repository\TrashService.

Definition at line 60 of file Core/Repository/SiteAccessAware/TrashService.php.

## ◆ loadTrashItem()

eZ\Publish\Core\Repository\SiteAccessAware\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

Implements eZ\Publish\API\Repository\TrashService.

Definition at line 35 of file Core/Repository/SiteAccessAware/TrashService.php.

## ◆ recover()

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

Recovers the $trashedLocation at its original place if possible.

Exceptions

Implements eZ\Publish\API\Repository\TrashService.

Definition at line 45 of file Core/Repository/SiteAccessAware/TrashService.php.

## ◆ trash()

eZ\Publish\Core\Repository\SiteAccessAware\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

Implements eZ\Publish\API\Repository\TrashService.

Definition at line 40 of file Core/Repository/SiteAccessAware/TrashService.php.

## Member Data Documentation

## ◆ $service

eZ\Publish\Core\Repository\SiteAccessAware\TrashService::$service
| protected

Definition at line 22 of file Core/Repository/SiteAccessAware/TrashService.php.

Referenced by eZ\Publish\Core\Repository\SiteAccessAware\TrashService\__construct().

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

- Core/Repository/SiteAccessAware/TrashService.php

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