eZPublishCommunityProject  2013.4
eZ\Publish\Core\SignalSlot\TrashService Class Reference
+ Inheritance diagram for eZ\Publish\Core\SignalSlot\TrashService:
+ Collaboration diagram for eZ\Publish\Core\SignalSlot\TrashService:

Public Member Functions

 __construct (TrashServiceInterface $service, SignalDispatcher $signalDispatcher)
 Constructor. More...
 
 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...
 

Protected Attributes

 $service
 
 $signalDispatcher
 

Constructor & Destructor Documentation

eZ\Publish\Core\SignalSlot\TrashService::__construct ( TrashServiceInterface  $service,
SignalDispatcher  $signalDispatcher 
)

Constructor.

Construct service object from aggregated service and signal dispatcher

Parameters
\eZ\Publish\API\Repository\TrashService$service
\eZ\Publish\Core\SignalSlot\SignalDispatcher$signalDispatcher

Member Function Documentation

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

Implements eZ\Publish\API\Repository\TrashService.

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

Implements eZ\Publish\API\Repository\TrashService.

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

Implements eZ\Publish\API\Repository\TrashService.

eZ\Publish\Core\SignalSlot\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
int$trashItemId
Returns

Implements eZ\Publish\API\Repository\TrashService.

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

Implements eZ\Publish\API\Repository\TrashService.

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

Implements eZ\Publish\API\Repository\TrashService.

Member Data Documentation

eZ\Publish\Core\SignalSlot\TrashService::$service
protected
eZ\Publish\Core\SignalSlot\TrashService::$signalDispatcher
protected

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