Class

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

class TreeHandler

The TreeHandler is an intersect between ContentHandler and LocationHandler, used to avoid circular dependency between them.

Methods

__construct(Gateway $locationGateway, Mapper $locationMapper, Gateway $contentGateway, Mapper $contentMapper, FieldHandler $fieldHandler)

ContentInfo loadContentInfo(int|string $contentId)

Returns the metadata object for a content identified by $contentId.

removeRawContent(int $contentId)

Deletes raw content data.

VersionInfo[] listVersions(mixed $contentId, mixed|null $status = null, int $limit = -1)

Returns the versions for $contentId.

Location loadLocation(int $locationId)

Loads the data for the location identified by $locationId.

bool removeSubtree(mixed $locationId)

Removes all Locations under and including $locationId.

setSectionForSubtree(mixed $locationId, mixed $sectionId)

Set section on all content objects in the subtree.

changeMainLocation(mixed $contentId, mixed $locationId)

Changes main location of content identified by given $contentId to location identified by given $locationId.

Details

at line 64
public __construct(Gateway $locationGateway, Mapper $locationMapper, Gateway $contentGateway, Mapper $contentMapper, FieldHandler $fieldHandler)

Parameters

Gateway $locationGateway
Mapper $locationMapper
Gateway $contentGateway
Mapper $contentMapper
FieldHandler $fieldHandler

at line 85
public ContentInfo loadContentInfo(int|string $contentId)

Returns the metadata object for a content identified by $contentId.

Parameters

int|string $contentId

Return Value

ContentInfo

at line 97
public removeRawContent(int $contentId)

Deletes raw content data.

Parameters

int $contentId

at line 125
public VersionInfo[] listVersions(mixed $contentId, mixed|null $status = null, int $limit = -1)

Returns the versions for $contentId.

Result is returned with oldest version first (using version id as it has index and is auto increment).

Parameters

mixed $contentId
mixed|null $status Optional argument to filter versions by status, like {see VersionInfo::STATUS_ARCHIVED}.
int $limit Limit for items returned, -1 means none.

Return Value

VersionInfo[]

at line 156
public Location loadLocation(int $locationId)

Loads the data for the location identified by $locationId.

Parameters

int $locationId

Return Value

Location

at line 176
public bool removeSubtree(mixed $locationId)

Removes all Locations under and including $locationId.

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.

Parameters

mixed $locationId

Return Value

bool

at line 213
public setSectionForSubtree(mixed $locationId, mixed $sectionId)

Set section on all content objects in the subtree.

Parameters

mixed $locationId
mixed $sectionId

at line 228
public changeMainLocation(mixed $contentId, mixed $locationId)

Changes main location of content identified by given $contentId to location identified by given $locationId.

Updates ezcontentobjecttree and eznodeassignment tables (eznode_assignment for content current version number).

Parameters

mixed $contentId
mixed $locationId