eZPublishCommunityProject  2012.12
eZ\Publish\Core\Persistence\Legacy\Content\Location\Trash\Handler Class Reference

The Location Handler interface defines operations on Location elements in the storage engine. More...

+ Inheritance diagram for eZ\Publish\Core\Persistence\Legacy\Content\Location\Trash\Handler:
+ Collaboration diagram for eZ\Publish\Core\Persistence\Legacy\Content\Location\Trash\Handler:

Public Member Functions

 __construct (LocationHandler $locationHandler, LocationGateway $locationGateway, LocationMapper $locationMapper, ContentHandler $contentHandler)
 Construct from userGateway. More...
 
 deleteTrashItem ($trashedId)
 Removes a trashed location identified by $trashedLocationId from trash Associated content has to be deleted. More...
 
 emptyTrash ()
 Empties the trash Everything contained in the trash must be removed. More...
 
 findTrashItems (Criterion $criterion=null, $offset=0, $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). More...
 
 loadTrashItem ($id)
 Loads the data for the trashed location identified by $id. More...
 
 recover ($trashedId, $newParentId)
 Returns a trashed location to normal state. More...
 
 trashSubtree ($locationId)
 Sends a subtree starting to $locationId to the trash and returns a Trashed object corresponding to $locationId. More...
 

Protected Member Functions

 delete (Trashed $trashItem)
 Triggers delete operations for $trashItem. More...
 

Protected Attributes

 $contentHandler
 
 $locationGateway
 
 $locationHandler
 
 $locationMapper
 

Detailed Description

The Location Handler interface defines operations on Location elements in the storage engine.

Constructor & Destructor Documentation

eZ\Publish\Core\Persistence\Legacy\Content\Location\Trash\Handler::__construct ( LocationHandler  $locationHandler,
LocationGateway  $locationGateway,
LocationMapper  $locationMapper,
ContentHandler  $contentHandler 
)

Construct from userGateway.

Parameters
\eZ\Publish\Core\Persistence\Legacy\Content\Location\Handler$locationHandler
\eZ\Publish\Core\Persistence\Legacy\Content\Location\Gateway$locationGateway
\eZ\Publish\Core\Persistence\Legacy\Content\Location\Mapper$locationMapper
\eZ\Publish\Core\Persistence\Legacy\Content\Handler$contentHandler
Returns

Member Function Documentation

eZ\Publish\Core\Persistence\Legacy\Content\Location\Trash\Handler::delete ( Trashed  $trashItem)
protected

Triggers delete operations for $trashItem.

If there is no more locations for corresponding content, then it will be deleted as well.

Parameters
\eZ\Publish\SPI\Persistence\Content\Location\Trashed$trashItem
Returns
void
eZ\Publish\Core\Persistence\Legacy\Content\Location\Trash\Handler::deleteTrashItem (   $trashedId)

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

Parameters
int$trashedId
Returns
void

Implements eZ\Publish\SPI\Persistence\Content\Location\Trash\Handler.

eZ\Publish\Core\Persistence\Legacy\Content\Location\Trash\Handler::emptyTrash ( )

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

Returns
void

Implements eZ\Publish\SPI\Persistence\Content\Location\Trash\Handler.

eZ\Publish\Core\Persistence\Legacy\Content\Location\Trash\Handler::findTrashItems ( Criterion  $criterion = null,
  $offset = 0,
  $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
\eZ\Publish\API\Repository\Values\Content\Query\Criterion$criterion
int$offsetOffset to start listing from, 0 by default
int$limitLimit for the listing. Null by default (no limit)
\eZ\Publish\API\Repository\Values\Content\Query\SortClause[]$sort
Returns
[]

Implements eZ\Publish\SPI\Persistence\Content\Location\Trash\Handler.

Referenced by eZ\Publish\Core\Persistence\Legacy\Content\Location\Trash\Handler\emptyTrash().

eZ\Publish\Core\Persistence\Legacy\Content\Location\Trash\Handler::loadTrashItem (   $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
Exceptions
\eZ\Publish\API\Repository\Exceptions\NotFoundException
Returns

Implements eZ\Publish\SPI\Persistence\Content\Location\Trash\Handler.

Referenced by eZ\Publish\Core\Persistence\Legacy\Content\Location\Trash\Handler\deleteTrashItem(), and eZ\Publish\Core\Persistence\Legacy\Content\Location\Trash\Handler\trashSubtree().

eZ\Publish\Core\Persistence\Legacy\Content\Location\Trash\Handler::recover (   $trashedId,
  $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
Returns
int Newly restored location id
Exceptions
\eZ\Publish\Core\Base\Exceptions\NotFoundExceptionIf $newParentId is invalid
Todo:
Handle field types actions

Implements eZ\Publish\SPI\Persistence\Content\Location\Trash\Handler.

eZ\Publish\Core\Persistence\Legacy\Content\Location\Trash\Handler::trashSubtree (   $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
Todo:
Handle field types actions
Returns
null| null if location was deleted, otherwise Trashed object

Implements eZ\Publish\SPI\Persistence\Content\Location\Trash\Handler.

Member Data Documentation

eZ\Publish\Core\Persistence\Legacy\Content\Location\Trash\Handler::$contentHandler
protected
eZ\Publish\Core\Persistence\Legacy\Content\Location\Trash\Handler::$locationGateway
protected
eZ\Publish\Core\Persistence\Legacy\Content\Location\Trash\Handler::$locationHandler
protected
eZ\Publish\Core\Persistence\Legacy\Content\Location\Trash\Handler::$locationMapper
protected

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