eZPublishCommunityProject  2013.6
eZ\Publish\API\Repository\TrashService Interface Reference
+ Inheritance diagram for eZ\Publish\API\Repository\TrashService:

Public Member Functions

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

Member Function Documentation

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

Deletes a trash item.

The corresponding content object will be removed

Exceptions
\eZ\Publish\API\Repository\Exceptions\UnauthorizedExceptionif the user is not allowed to delete this trash item
Parameters
\eZ\Publish\API\Repository\Values\Content\TrashItem$trashItem

Implemented in eZ\Publish\Core\SignalSlot\TrashService.

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
\eZ\Publish\API\Repository\Exceptions\UnauthorizedExceptionif the user is not allowed to empty the trash

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

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

Returns a collection of Trashed locations contained in the trash.

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

Parameters
\eZ\Publish\API\Repository\Values\Content\Query$query
Returns

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

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
\eZ\Publish\API\Repository\Exceptions\UnauthorizedExceptionif the user is not allowed to read the trashed location
\eZ\Publish\API\Repository\Exceptions\NotFoundException- if the location with the given id does not exist
Parameters
mixed$trashItemId
Returns

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

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

Recovers the $trashedLocation at its original place if possible.

Exceptions
\eZ\Publish\API\Repository\Exceptions\UnauthorizedExceptionif the user is not allowed to recover the trash item at the parent location location

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

Parameters
\eZ\Publish\API\Repository\Values\Content\TrashItem$trashItem
\eZ\Publish\API\Repository\Values\Content\Location$newParentLocation
Returns
the newly created or recovered location

Implemented in eZ\Publish\Core\SignalSlot\TrashService.

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

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

Content is left untouched.

Exceptions
\eZ\Publish\API\Repository\Exceptions\UnauthorizedExceptionif the user is not allowed to trash the given location
Parameters
\eZ\Publish\API\Repository\Values\Content\Location$location
Returns
null| null if location was deleted, otherwise TrashItem

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


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