eZPublishCommunityProject  2013.9
eZ\Publish\Core\REST\Client\TrashService Class Reference
+ Inheritance diagram for eZ\Publish\Core\REST\Client\TrashService:
+ Collaboration diagram for eZ\Publish\Core\REST\Client\TrashService:

Public Member Functions

 __construct (LocationService $locationService, HttpClient $client, Dispatcher $inputDispatcher, Visitor $outputVisitor, RequestParser $requestParser)
 
 deleteTrashItem (APITrashItem $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 (APITrashItem $trashItem, Location $newParentLocation=null)
 Recovers the $trashedLocation at its original place if possible. More...
 
 setSession ($id)
 Set session ID. More...
 
 trash (Location $location)
 Sends $location and all its children to trash and returns the corresponding trash item. More...
 
- Public Member Functions inherited from eZ\Publish\API\Repository\TrashService
 deleteTrashItem (TrashItem $trashItem)
 Deletes a trash item. More...
 
 recover (TrashItem $trashItem, Location $newParentLocation=null)
 Recovers the $trashedLocation at its original place if possible. More...
 

Protected Member Functions

 buildTrashItem (Location $location)
 Converts the Location value object to TrashItem value object. More...
 

Private Attributes

 $client
 
 $inputDispatcher
 
 $locationService
 
 $outputVisitor
 
 $requestParser
 

Constructor & Destructor Documentation

eZ\Publish\Core\REST\Client\TrashService::__construct ( LocationService  $locationService,
HttpClient  $client,
Dispatcher  $inputDispatcher,
Visitor  $outputVisitor,
RequestParser  $requestParser 
)
Parameters
\eZ\Publish\Core\REST\Client\LocationService$locationService
\eZ\Publish\Core\REST\Client\HttpClient$client
\eZ\Publish\Core\REST\Common\Input\Dispatcher$inputDispatcher
\eZ\Publish\Core\REST\Common\Output\Visitor$outputVisitor
\eZ\Publish\Core\REST\Common\RequestParser$requestParser

Member Function Documentation

eZ\Publish\Core\REST\Client\TrashService::buildTrashItem ( Location  $location)
protected

Converts the Location value object to TrashItem value object.

Parameters
\eZ\Publish\API\Repository\Values\Content\Location$location
Returns

Referenced by eZ\Publish\Core\REST\Client\TrashService\findTrashItems(), and eZ\Publish\Core\REST\Client\TrashService\loadTrashItem().

eZ\Publish\Core\REST\Client\TrashService::deleteTrashItem ( APITrashItem  $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
eZ\Publish\Core\REST\Client\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\REST\Client\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\REST\Client\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

Implements eZ\Publish\API\Repository\TrashService.

eZ\Publish\Core\REST\Client\TrashService::recover ( APITrashItem  $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
eZ\Publish\Core\REST\Client\TrashService::setSession (   $id)

Set session ID.

Only for testing

Parameters
mixed$id

Implements eZ\Publish\Core\REST\Client\Sessionable.

eZ\Publish\Core\REST\Client\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\REST\Client\TrashService::$client
private
eZ\Publish\Core\REST\Client\TrashService::$inputDispatcher
private
eZ\Publish\Core\REST\Client\TrashService::$locationService
private
eZ\Publish\Core\REST\Client\TrashService::$outputVisitor
private
eZ\Publish\Core\REST\Client\TrashService::$requestParser
private

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