Class

eZ\Publish\Core\Persistence\Cache\TrashHandler

class TrashHandler extends AbstractHandler implements Handler

Methods

Trashed loadTrashItem(int $id)

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

null|Trashed trashSubtree(mixed $locationId)

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

int recover(mixed $trashedId, mixed $newParentId)

Returns a trashed location to normal state.

Trashed[] findTrashItems(Criterion $criterion = null, int $offset, int $limit = null, array $sort = null)

Returns an array of all trashed locations satisfying the $criterion (if provided), sorted with SortClause objects contained in $sort (if any).

emptyTrash()

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

deleteTrashItem(int $trashedId)

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

Details

at line 22
public Trashed loadTrashItem(int $id)

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

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

Parameters

int $id

Return Value

Trashed

Exceptions

NotFoundException

at line 32
public null|Trashed trashSubtree(mixed $locationId)

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

mixed $locationId

Return Value

null|Trashed null if location was deleted, otherwise Trashed object

at line 45
public int recover(mixed $trashedId, mixed $newParentId)

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

mixed $trashedId
mixed $newParentId

Return Value

int Newly restored location id

Exceptions

NotFoundException If $newParentId is invalid

at line 58
public Trashed[] findTrashItems(Criterion $criterion = null, int $offset, int $limit = null, array $sort = null)

Returns an array of all trashed locations satisfying the $criterion (if provided), sorted with SortClause objects contained in $sort (if any).

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

Parameters

Criterion $criterion
int $offset Offset to start listing from, 0 by default
int $limit Limit for the listing. Null by default (no limit)
array $sort

Return Value

Trashed[]

at line 68
public emptyTrash()

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

at line 77
public deleteTrashItem(int $trashedId)

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

Parameters

int $trashedId