PHP Class eZ\Publish\Core\Persistence\Legacy\Content\TreeHandler

Show file Open project: ezsystems/ezpublish-kernel Class Usage Examples

Protected Properties

Property Type Description
$contentGateway Gateway Content gateway.
$contentMapper Mapper Content handler.
$fieldHandler FieldHandler FieldHandler.
$locationGateway eZ\Publish\Core\Persistence\Legacy\Content\Location\Gateway Gateway for handling location data.
$locationMapper eZ\Publish\Core\Persistence\Legacy\Content\Location\Mapper Location Mapper.

Public Methods

Method Description
__construct ( Gateway $locationGateway, Mapper $locationMapper, Gateway $contentGateway, Mapper $contentMapper, FieldHandler $fieldHandler )
changeMainLocation ( mixed $contentId, mixed $locationId ) Changes main location of content identified by given $contentId to location identified by given $locationId.
listVersions ( integer $contentId ) : eZ\Publish\SPI\Persistence\Content\VersionInfo[] Returns the versions for $contentId.
loadContentInfo ( integer | string $contentId ) : eZ\Publish\SPI\Persistence\Content\ContentInfo Returns the metadata object for a content identified by $contentId.
loadLocation ( integer $locationId ) : eZ\Publish\SPI\Persistence\Content\Location Loads the data for the location identified by $locationId.
removeRawContent ( integer $contentId ) Deletes raw content data.
removeSubtree ( mixed $locationId ) : boolean Removes all Locations under and including $locationId.
setSectionForSubtree ( mixed $locationId, mixed $sectionId ) Set section on all content objects in the subtree.

Method Details

__construct() public method

public __construct ( Gateway $locationGateway, Mapper $locationMapper, Gateway $contentGateway, Mapper $contentMapper, FieldHandler $fieldHandler )
$locationGateway eZ\Publish\Core\Persistence\Legacy\Content\Location\Gateway
$locationMapper eZ\Publish\Core\Persistence\Legacy\Content\Location\Mapper
$contentGateway Gateway
$contentMapper Mapper
$fieldHandler FieldHandler

changeMainLocation() public method

Updates ezcontentobject_tree and eznode_assignment tables (eznode_assignment for content current version number).
public changeMainLocation ( mixed $contentId, mixed $locationId )
$contentId mixed
$locationId mixed

listVersions() public method

Result is returned with oldest version first (using version id as it has index and is auto increment).
public listVersions ( integer $contentId ) : eZ\Publish\SPI\Persistence\Content\VersionInfo[]
$contentId integer
return eZ\Publish\SPI\Persistence\Content\VersionInfo[]

loadContentInfo() public method

Returns the metadata object for a content identified by $contentId.
public loadContentInfo ( integer | string $contentId ) : eZ\Publish\SPI\Persistence\Content\ContentInfo
$contentId integer | string
return eZ\Publish\SPI\Persistence\Content\ContentInfo

loadLocation() public method

Loads the data for the location identified by $locationId.
public loadLocation ( integer $locationId ) : eZ\Publish\SPI\Persistence\Content\Location
$locationId integer
return eZ\Publish\SPI\Persistence\Content\Location

removeRawContent() public method

Deletes raw content data.
public removeRawContent ( integer $contentId )
$contentId integer

removeSubtree() public method

Performs a recursive delete on the location identified by $locationId, including all of its child locations. Content which is not referred to by any other location is automatically removed. Content which looses its main Location will get the first of its other Locations assigned as the new main Location.
public removeSubtree ( mixed $locationId ) : boolean
$locationId mixed
return boolean

setSectionForSubtree() public method

Set section on all content objects in the subtree.
public setSectionForSubtree ( mixed $locationId, mixed $sectionId )
$locationId mixed
$sectionId mixed

Property Details

$contentGateway protected property

Content gateway.
protected Gateway,eZ\Publish\Core\Persistence\Legacy\Content $contentGateway
return Gateway

$contentMapper protected property

Content handler.
protected Mapper,eZ\Publish\Core\Persistence\Legacy\Content $contentMapper
return Mapper

$fieldHandler protected property

FieldHandler.
protected FieldHandler,eZ\Publish\Core\Persistence\Legacy\Content $fieldHandler
return FieldHandler

$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

$locationMapper protected property

Location Mapper.
protected Mapper,eZ\Publish\Core\Persistence\Legacy\Content\Location $locationMapper
return eZ\Publish\Core\Persistence\Legacy\Content\Location\Mapper