PHP Class eZ\Publish\Core\Persistence\Legacy\Content\Location\Trash\Handler

Inheritance: implements eZ\Publish\SPI\Persistence\Content\Location\Trash\Handler
Show file Open project: ezsystems/ezpublish-kernel

Protected Properties

Property Type Description
$contentHandler eZ\Publish\Core\Persistence\Legacy\Content\Handler Content handler.
$locationGateway eZ\Publish\Core\Persistence\Legacy\Content\Location\Gateway Gateway for handling location data.
$locationHandler eZ\Publish\Core\Persistence\Legacy\Content\Location\Handler Location handler.
$locationMapper eZ\Publish\Core\Persistence\Legacy\Content\Location\Mapper Mapper for handling location data.

Public Methods

Method Description
__construct ( Handler $locationHandler, Gateway $locationGateway, Mapper $locationMapper, Handler $contentHandler ) : Handler Construct from userGateway.
deleteTrashItem ( integer $trashedId ) Removes a trashed location identified by $trashedLocationId from trash Associated content has to be deleted.
emptyTrash ( ) Empties the trash Everything contained in the trash must be removed.
findTrashItems ( eZ\Publish\API\Repository\Values\Content\Query\Criterion $criterion = null, integer $offset, integer $limit = null, array $sort = null ) : eZ\Publish\SPI\Persistence\Content\Location\Trashed[] Returns an array of all trashed locations satisfying the $criterion (if provided), sorted with SortClause objects contained in $sort (if any).
loadTrashItem ( integer $id ) : eZ\Publish\SPI\Persistence\Content\Location\Trashed Loads the data for the trashed location identified by $id.
recover ( mixed $trashedId, mixed $newParentId ) : integer Returns a trashed location to normal state.
trashSubtree ( mixed $locationId ) : null | eZ\Publish\SPI\Persistence\Content\Location\Trashed Sends a subtree starting to $locationId to the trash and returns a Trashed object corresponding to $locationId.

Protected Methods

Method Description
delete ( eZ\Publish\SPI\Persistence\Content\Location\Trashed $trashItem ) Triggers delete operations for $trashItem.

Method Details

__construct() public method

Construct from userGateway.
public __construct ( Handler $locationHandler, Gateway $locationGateway, Mapper $locationMapper, Handler $contentHandler ) : Handler
$locationHandler eZ\Publish\Core\Persistence\Legacy\Content\Location\Handler
$locationGateway eZ\Publish\Core\Persistence\Legacy\Content\Location\Gateway
$locationMapper eZ\Publish\Core\Persistence\Legacy\Content\Location\Mapper
$contentHandler eZ\Publish\Core\Persistence\Legacy\Content\Handler
return Handler

delete() protected method

If there is no more locations for corresponding content, then it will be deleted as well.
protected delete ( eZ\Publish\SPI\Persistence\Content\Location\Trashed $trashItem )
$trashItem eZ\Publish\SPI\Persistence\Content\Location\Trashed

deleteTrashItem() public method

Removes a trashed location identified by $trashedLocationId from trash Associated content has to be deleted.
public deleteTrashItem ( integer $trashedId )
$trashedId integer

emptyTrash() public method

Empties the trash Everything contained in the trash must be removed.
public emptyTrash ( )

findTrashItems() public method

If no criterion is provided (null), no filter is applied.
public findTrashItems ( eZ\Publish\API\Repository\Values\Content\Query\Criterion $criterion = null, integer $offset, integer $limit = null, array $sort = null ) : eZ\Publish\SPI\Persistence\Content\Location\Trashed[]
$criterion eZ\Publish\API\Repository\Values\Content\Query\Criterion
$offset integer Offset to start listing from, 0 by default
$limit integer Limit for the listing. Null by default (no limit)
$sort array
return eZ\Publish\SPI\Persistence\Content\Location\Trashed[]

loadTrashItem() public method

$id is the same as original location (which has been previously trashed).
public loadTrashItem ( integer $id ) : eZ\Publish\SPI\Persistence\Content\Location\Trashed
$id integer
return eZ\Publish\SPI\Persistence\Content\Location\Trashed

recover() public method

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.
public recover ( mixed $trashedId, mixed $newParentId ) : integer
$trashedId mixed
$newParentId mixed
return integer Newly restored location id

trashSubtree() public method

Moves all locations in the subtree to the Trash. The associated content objects are left untouched.
public trashSubtree ( mixed $locationId ) : null | eZ\Publish\SPI\Persistence\Content\Location\Trashed
$locationId mixed
return null | eZ\Publish\SPI\Persistence\Content\Location\Trashed null if location was deleted, otherwise Trashed object

Property Details

$contentHandler protected property

Content handler.
protected Handler,eZ\Publish\Core\Persistence\Legacy\Content $contentHandler
return eZ\Publish\Core\Persistence\Legacy\Content\Handler

$locationGateway protected property

Gateway for handling location data.
protected Gateway,eZ\Publish\Core\Persistence\Legacy\Content\Location $locationGateway
return eZ\Publish\Core\Persistence\Legacy\Content\Location\Gateway

$locationHandler protected property

Location handler.
protected Handler,eZ\Publish\Core\Persistence\Legacy\Content\Location $locationHandler
return eZ\Publish\Core\Persistence\Legacy\Content\Location\Handler

$locationMapper protected property

Mapper for handling location data.
protected Mapper,eZ\Publish\Core\Persistence\Legacy\Content\Location $locationMapper
return eZ\Publish\Core\Persistence\Legacy\Content\Location\Mapper