Interface

eZ\Publish\SPI\Persistence\Content\Location\Handler

interface Handler

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

Methods

Location load(int $locationId)

Loads the data for the location identified by $locationId.

array loadSubtreeIds(int $locationId)

Loads the subtree ids of the location identified by $locationId.

Location loadByRemoteId(string $remoteId)

Loads the data for the location identified by $remoteId.

Location[] loadLocationsByContent(int $contentId, int $rootLocationId = null)

Loads all locations for $contentId, optionally limited to a sub tree identified by $rootLocationId.

Location[] loadParentLocationsForDraftContent(mixed $contentId)

Loads all parent Locations for unpublished Content by given $contentId.

Location copySubtree(mixed $sourceId, mixed $destinationParentId)

Copy location object identified by $sourceId, into destination identified by $destinationParentId.

bool move(mixed $sourceId, mixed $destinationParentId)

Moves location identified by $sourceId into new parent identified by $destinationParentId.

markSubtreeModified(int|string $locationId, int $timestamp = null)

Marks the given nodes and all ancestors as modified.

hide(mixed $id)

Sets a location to be hidden, and it self + all children to invisible.

unHide(mixed $id)

Sets a location to be unhidden, and self + children to visible unless a parent is hiding the tree.

bool swap(mixed $locationId1, mixed $locationId2)

Swaps the content object being pointed to by a location object.

update(UpdateStruct $location, int $locationId)

Updates an existing location.

Location create(CreateStruct $location)

Creates a new location rooted at $location->parentId.

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 27
public Location load(int $locationId)

Loads the data for the location identified by $locationId.

Parameters

int $locationId

Return Value

Location

Exceptions

NotFoundException

at line 38
public array loadSubtreeIds(int $locationId)

Loads the subtree ids of the location identified by $locationId.

Parameters

int $locationId

Return Value

array Location ids are in the index, Content ids in the value.

Exceptions

NotFoundException

at line 49
public Location loadByRemoteId(string $remoteId)

Loads the data for the location identified by $remoteId.

Parameters

string $remoteId

Return Value

Location

Exceptions

NotFoundException

at line 60
public Location[] loadLocationsByContent(int $contentId, int $rootLocationId = null)

Loads all locations for $contentId, optionally limited to a sub tree identified by $rootLocationId.

Parameters

int $contentId
int $rootLocationId

Return Value

Location[]

at line 70
public Location[] loadParentLocationsForDraftContent(mixed $contentId)

Loads all parent Locations for unpublished Content by given $contentId.

Parameters

mixed $contentId

Return Value

Location[]

at line 87
public Location copySubtree(mixed $sourceId, mixed $destinationParentId)

Copy location object identified by $sourceId, into destination identified by $destinationParentId.

Performs a deep copy of the location identified by $sourceId and all of its child locations, copying the most recent published content object for each location to a new content object without any additional version information. Relations for published version are copied. URLs are not touched at all.

Parameters

mixed $sourceId
mixed $destinationParentId

Return Value

Location the newly created Location.

Exceptions

NotFoundException If $sourceId or $destinationParentId are invalid

at line 101
public bool move(mixed $sourceId, mixed $destinationParentId)

Moves location identified by $sourceId into new parent identified by $destinationParentId.

Performs a full move of the location identified by $sourceId to a new destination, identified by $destinationParentId. Relations do not need to be updated, since they refer to Content. URLs are not touched.

Parameters

mixed $sourceId
mixed $destinationParentId

Return Value

bool

at line 114
public markSubtreeModified(int|string $locationId, int $timestamp = null)

Marks the given nodes and all ancestors as modified.

Optionally a time stamp with the modification date may be specified, otherwise the current time is used.

Parameters

int|string $locationId
int $timestamp

at line 121
public hide(mixed $id)

Sets a location to be hidden, and it self + all children to invisible.

Parameters

mixed $id Location ID

at line 129
public unHide(mixed $id)

Sets a location to be unhidden, and self + children to visible unless a parent is hiding the tree.

If not make sure only children down to first hidden node is marked visible.

Parameters

mixed $id

at line 142
public bool swap(mixed $locationId1, mixed $locationId2)

Swaps the content object being pointed to by a location object.

Make the location identified by $locationId1 refer to the Content referred to by $locationId2 and vice versa.

Parameters

mixed $locationId1
mixed $locationId2

Return Value

bool

at line 150
public update(UpdateStruct $location, int $locationId)

Updates an existing location.

Parameters

UpdateStruct $location
int $locationId

at line 159
public Location create(CreateStruct $location)

Creates a new location rooted at $location->parentId.

Parameters

CreateStruct $location

Return Value

Location

at line 174
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 187
public setSectionForSubtree(mixed $locationId, mixed $sectionId)

Set section on all content objects in the subtree.

Only main locations will be updated.

Parameters

mixed $locationId
mixed $sectionId

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

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

Parameters

mixed $contentId
mixed $locationId