Class

eZ\Publish\Core\Persistence\Cache\LocationHandler

class LocationHandler extends AbstractHandler implements Handler

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[] 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 loadByRemoteId(string $remoteId)

Loads the data for the location identified by $remoteId.

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($locationId)

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

unHide($locationId)

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 $struct, int $locationId)

Updates an existing location.

Location create(CreateStruct $locationStruct)

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

Loads the data for the location identified by $locationId.

Parameters

int $locationId

Return Value

Location

Exceptions

NotFoundException

at line 44
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 69
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 99
public Location[] loadParentLocationsForDraftContent(mixed $contentId)

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

Parameters

mixed $contentId

Return Value

Location[]

at line 123
public Location loadByRemoteId(string $remoteId)

Loads the data for the location identified by $remoteId.

Parameters

string $remoteId

Return Value

Location

Exceptions

NotFoundException

at line 143
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 153
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 166
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 175
public hide($locationId)

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

Parameters

$locationId

at line 188
public unHide($locationId)

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

$locationId

at line 201
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 221
public update(UpdateStruct $struct, int $locationId)

Updates an existing location.

Parameters

UpdateStruct $struct
int $locationId

at line 232
public Location create(CreateStruct $locationStruct)

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

Parameters

CreateStruct $locationStruct

Return Value

Location

at line 247
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 260
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 271
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