Class

eZ\Publish\Core\Persistence\Legacy\Content\Location\Gateway

abstract class Gateway

Base class for location gateways.

Constants

NODE_ASSIGNMENT_OP_CODE_NOP

Constants for node assignment op codes.

NODE_ASSIGNMENT_OP_CODE_EXECUTE

NODE_ASSIGNMENT_OP_CODE_CREATE_NOP

NODE_ASSIGNMENT_OP_CODE_CREATE

NODE_ASSIGNMENT_OP_CODE_MOVE_NOP

NODE_ASSIGNMENT_OP_CODE_MOVE

NODE_ASSIGNMENT_OP_CODE_REMOVE_NOP

NODE_ASSIGNMENT_OP_CODE_REMOVE

NODE_ASSIGNMENT_OP_CODE_SET_NOP

NODE_ASSIGNMENT_OP_CODE_SET

Methods

array getBasicNodeData(mixed $nodeId)

Returns an array with basic node data.

array getBasicNodeDataByRemoteId(mixed $remoteId)

Returns an array with basic node data for the node with $remoteId.

array loadLocationDataByContent(int $contentId, int $rootLocationId = null)

Loads data for all Locations for $contentId, optionally only in the subtree starting at $rootLocationId.

array loadParentLocationsDataForDraftContent(mixed $contentId)

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

array getSubtreeContent(mixed $sourceId, bool $onlyIds = false)

Find all content in the given subtree.

array getChildren(mixed $locationId)

Returns data for the first level children of the location identified by given $locationId.

moveSubtreeNodes(array $fromPathString, array $toPathString)

Update path strings to move nodes in the ezcontentobject_tree table.

updateSubtreeModificationTime(string $pathString, int|null $timestamp = null)

Updated subtree modification time for all nodes on path.

updateNodeAssignment(int $contentObjectId, int $oldParent, int $newParent, int $opcode)

Update node assignment table.

createLocationsFromNodeAssignments(mixed $contentId, mixed $versionNo)

Create locations from node assignments.

updateLocationsContentVersionNo(mixed $contentId, mixed $versionNo)

Updates all Locations of content identified with $contentId with $versionNo.

hideSubtree(string $pathString)

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

unHideSubtree(string $pathString)

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.

Location create(CreateStruct $createStruct, array $parentNode)

Creates a new location in given $parentNode.

createNodeAssignment(CreateStruct $createStruct, mixed $parentNodeId, int $type = self::NODE_ASSIGNMENT_OP_CODE_CREATE_NOP)

Create an entry in the node assignment table.

deleteNodeAssignment(int $contentId, int $versionNo = null)

Deletes node assignment for given $contentId and $versionNo.

update(UpdateStruct $location, int $locationId)

Updates an existing location.

updatePathIdentificationString(mixed $locationId, mixed $parentLocationId, string $text)

Updates path identification string for given $locationId.

removeLocation(mixed $locationId)

Deletes ezcontentobjecttree row for given $locationId (nodeid).

array getFallbackMainNodeData(mixed $contentId, mixed $locationId)

Returns id of the next in line node to be set as a new main node.

bool trashLocation(mixed $locationId)

Sends a single location identified by given $locationId to the trash.

Location untrashLocation(mixed $locationId, mixed $newParentId = null)

Returns a trashed location to normal state.

array loadTrashByLocation(mixed $locationId)

Loads trash data specified by location ID.

cleanupTrash()

Removes every entries in the trash.

array listTrashed(int $offset, int $limit, array $sort = null)

Lists trashed items.

removeElementFromTrash(int $id)

Removes trashed element identified by $id from trash.

bool setSectionForSubtree(mixed $pathString, mixed $sectionId)

Set section on all content objects in the subtree.

int countLocationsByContentId(int $contentId)

Returns how many locations given content object identified by $contentId has.

changeMainLocation(mixed $contentId, mixed $locationId, mixed $versionNo, mixed $parentLocationId)

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

Details

at line 45
abstract public array getBasicNodeData(mixed $nodeId)

Returns an array with basic node data.

We might want to cache this, since this method is used by about every method in the location handler.

Parameters

mixed $nodeId

Return Value

array

at line 56
abstract public array getBasicNodeDataByRemoteId(mixed $remoteId)

Returns an array with basic node data for the node with $remoteId.

Parameters

mixed $remoteId

Return Value

array

at line 67
abstract public array loadLocationDataByContent(int $contentId, int $rootLocationId = null)

Loads data for all Locations for $contentId, optionally only in the subtree starting at $rootLocationId.

Parameters

int $contentId
int $rootLocationId

Return Value

array

at line 76
abstract public array loadParentLocationsDataForDraftContent(mixed $contentId)

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

Parameters

mixed $contentId

Return Value

array

at line 86
abstract public array getSubtreeContent(mixed $sourceId, bool $onlyIds = false)

Find all content in the given subtree.

Parameters

mixed $sourceId
bool $onlyIds

Return Value

array

at line 95
abstract public array getChildren(mixed $locationId)

Returns data for the first level children of the location identified by given $locationId.

Parameters

mixed $locationId

Return Value

array

at line 108
abstract public moveSubtreeNodes(array $fromPathString, array $toPathString)

Update path strings to move nodes in the ezcontentobject_tree table.

This query can likely be optimized to use some more advanced string operations, which then depend on the respective database.

Parameters

array $fromPathString
array $toPathString

at line 116
abstract public updateSubtreeModificationTime(string $pathString, int|null $timestamp = null)

Updated subtree modification time for all nodes on path.

Parameters

string $pathString
int|null $timestamp

at line 126
abstract public updateNodeAssignment(int $contentObjectId, int $oldParent, int $newParent, int $opcode)

Update node assignment table.

Parameters

int $contentObjectId
int $oldParent
int $newParent
int $opcode

at line 136
abstract public createLocationsFromNodeAssignments(mixed $contentId, mixed $versionNo)

Create locations from node assignments.

Convert existing node assignments into real locations.

Parameters

mixed $contentId
mixed $versionNo

at line 144
abstract public updateLocationsContentVersionNo(mixed $contentId, mixed $versionNo)

Updates all Locations of content identified with $contentId with $versionNo.

Parameters

mixed $contentId
mixed $versionNo

at line 151
abstract public hideSubtree(string $pathString)

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

Parameters

string $pathString

at line 159
abstract public unHideSubtree(string $pathString)

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

string $pathString

at line 172
abstract 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 182
abstract public Location create(CreateStruct $createStruct, array $parentNode)

Creates a new location in given $parentNode.

Parameters

CreateStruct $createStruct
array $parentNode

Return Value

Location

at line 191
abstract public createNodeAssignment(CreateStruct $createStruct, mixed $parentNodeId, int $type = self::NODE_ASSIGNMENT_OP_CODE_CREATE_NOP)

Create an entry in the node assignment table.

Parameters

CreateStruct $createStruct
mixed $parentNodeId
int $type

at line 199
abstract public deleteNodeAssignment(int $contentId, int $versionNo = null)

Deletes node assignment for given $contentId and $versionNo.

Parameters

int $contentId
int $versionNo

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

Updates an existing location.

Will not throw anything if location id is invalid or no entries are affected.

Parameters

UpdateStruct $location
int $locationId

at line 218
abstract public updatePathIdentificationString(mixed $locationId, mixed $parentLocationId, string $text)

Updates path identification string for given $locationId.

Parameters

mixed $locationId
mixed $parentLocationId
string $text

at line 225
abstract public removeLocation(mixed $locationId)

Deletes ezcontentobjecttree row for given $locationId (nodeid).

Parameters

mixed $locationId

at line 239
abstract public array getFallbackMainNodeData(mixed $contentId, mixed $locationId)

Returns id of the next in line node to be set as a new main node.

This returns lowest node id for content identified by $contentId, and not of the node identified by given $locationId (current main node). Assumes that content has more than one location.

Parameters

mixed $contentId
mixed $locationId

Return Value

array

at line 250
abstract public bool trashLocation(mixed $locationId)

Sends a single location identified by given $locationId to the trash.

The associated content object is left untouched.

Parameters

mixed $locationId

Return Value

bool

at line 265
abstract public Location untrashLocation(mixed $locationId, mixed $newParentId = null)

Returns a trashed location to normal state.

Recreates the originally trashed location in the new position. If no new position has been specified, it will be tried to re-create the location at the old position. If this is not possible ( because the old location does not exist any more) and exception is thrown.

Parameters

mixed $locationId
mixed $newParentId

Return Value

Location

at line 274
abstract public array loadTrashByLocation(mixed $locationId)

Loads trash data specified by location ID.

Parameters

mixed $locationId

Return Value

array

at line 282
abstract public cleanupTrash()

Removes every entries in the trash.

Will NOT remove associated content objects nor attributes.

Basically truncates ezcontentobject_trash table.

at line 294
abstract public array listTrashed(int $offset, int $limit, array $sort = null)

Lists trashed items.

Returns entries from ezcontentobject_trash.

Parameters

int $offset
int $limit
array $sort

Return Value

array

at line 302
abstract public removeElementFromTrash(int $id)

Removes trashed element identified by $id from trash.

Will NOT remove associated content object nor attributes.

Parameters

int $id The trashed location Id

at line 312
abstract public bool setSectionForSubtree(mixed $pathString, mixed $sectionId)

Set section on all content objects in the subtree.

Parameters

mixed $pathString
mixed $sectionId

Return Value

bool

at line 321
abstract public int countLocationsByContentId(int $contentId)

Returns how many locations given content object identified by $contentId has.

Parameters

int $contentId

Return Value

int

at line 335
abstract public changeMainLocation(mixed $contentId, mixed $locationId, mixed $versionNo, mixed $parentLocationId)

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

Updates ezcontentobjecttree table for the given $contentId and eznodeassignment table for the given $contentId, $parentLocationId and $versionNo

Parameters

mixed $contentId
mixed $locationId
mixed $versionNo version number, needed to update eznode_assignment table
mixed $parentLocationId parent location of location identified by $locationId, needed to update eznode_assignment table