Copied!

TrashServiceDecorator

TrashServiceDecorator.php : 19
Implements TrashService

Properties

protected $innerService

TrashServiceDecorator.php : 22
protected TrashService $innerService

Methods

public__construct()

TrashServiceDecorator.php : 24
public __construct(TrashService $innerService)

Parameters

Name Type Default value Description
$innerService TrashService - -

publicdeleteTrashItem()

TrashServiceDecorator.php : 51

Deletes a trash item.

public deleteTrashItem(TrashItem $trashItem) : TrashItemDeleteResult

The corresponding content object will be removed

Parameters

Name Type Default value Description
$trashItem TrashItem - -

Return values

TrashItemDeleteResult

publicemptyTrash()

TrashServiceDecorator.php : 46

Empties trash.

public emptyTrash() : TrashItemDeleteResultList

All locations contained in the trash will be removed. Content objects will be removed if all locations of the content are gone.

Return values

TrashItemDeleteResultList

publicfindTrashItems()

TrashServiceDecorator.php : 56

Returns a collection of Trashed locations contained in the trash, which are readable by the current user.

public findTrashItems(Query $query) : SearchResult

$query allows to filter/sort the elements to be contained in the collection.

Parameters

Name Type Default value Description
$query Query - -

Return values

SearchResult

publicloadTrashItem()

TrashServiceDecorator.php : 29

Loads a trashed location object from its $id.

public loadTrashItem(int $trashItemId) : TrashItem

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

Parameters

Name Type Default value Description
$trashItemId int - -

Return values

TrashItem

publicrecover()

TrashServiceDecorator.php : 39

Recovers the $trashedLocation at its original place if possible.

public recover(TrashItem $trashItem[, Location $newParentLocation = null ]) : Location

If $newParentLocation is provided, $trashedLocation will be restored under it.

Parameters

Name Type Default value Description
$trashItem TrashItem - -
$newParentLocation Location null -

Return values

Location

the newly created or recovered location

publictrash()

TrashServiceDecorator.php : 34

Sends $location and all its children to trash and returns the corresponding trash item.

public trash(Location $location) : TrashItem|null

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