PHP Interface Jackalope\Transport\WritingInterface

Notes: Registering and removing namespaces is also part of this chapter. The announced IDENTIFIER_STABILITY must be guaranteed by the transport. The interface does not differ though.
Inheritance: extends Jackalope\Transport\TransportInterface
Show file Open project: jackalope/jackalope Interface Usage Examples

Public Methods

Method Description
assertValidName ( string $name ) : boolean Whether this node name conforms to the specification
cloneFrom ( string $srcWorkspace, string $srcAbsPath, string $destAbsPath, boolean $removeExisting ) Clones the subgraph at the node srcAbsPath in srcWorkspace to the new location at destAbsPath in this workspace.
copyNode ( string $srcAbsPath, string $destAbsPath, string $srcWorkspace = null ) Copies a Node from src (potentially from another workspace) to dst in the current workspace.
deleteNodeImmediately ( string $path ) Deletes a node and the whole subtree under it outside of a transaction
deleteNodes ( array $operations ) Perform a batch remove operation.
deleteProperties ( array $operations ) Perform a batch remove operation.
deletePropertyImmediately ( string $path ) Deletes a property outside of a transaction
finishSave ( ) Called after everything internally is done in the save() method so the transport has a chance to do final stuff (or commit everything at once).
moveNodeImmediately ( string $srcAbsPath, string $dstAbsPath ) Moves a node from src to dst outside of a transaction
moveNodes ( array $operations ) Perform a batch of move operations in the order of the passed array
prepareSave ( ) Called before any data is written.
registerNamespace ( string $prefix, string $uri ) Register a new namespace.
reorderChildren ( Node $node ) Reorder the children of $node as the node said it needs them reordered.
rollbackSave ( ) Called if a save operation caused an exception.
storeNodes ( array $operations ) Store all nodes in the AddNodeOperations
unregisterNamespace ( string $prefix ) Unregister an existing namespace.
updateNode ( Node $node, string $srcWorkspace ) Update a node and its children to match its corresponding node in the specified workspace
updateProperties ( Node $node ) Update the properties of a node

Method Details

assertValidName() public method

Note: There is a minimal implementation in BaseTransport
See also: http://www.day.com/specs/jcr/2.0/3_Repository_Model.html#3.2.2%20Local%20Names
public assertValidName ( string $name ) : boolean
$name string The name to check
return boolean always true, if the name is not valid a RepositoryException is thrown

cloneFrom() public method

There may be no node at dstAbsPath This method does not need to load the node but can execute the clone directly in the storage.
See also: WorkspaceInterface::cloneFrom
public cloneFrom ( string $srcWorkspace, string $srcAbsPath, string $destAbsPath, boolean $removeExisting )
$srcWorkspace string The workspace where the source node can be found
$srcAbsPath string Absolute source path to the node
$destAbsPath string Absolute destination path including the new node name
$removeExisting boolean whether to remove a node with the same identifier if there exists one

copyNode() public method

This method does not need to load the node but can execute the copy directly in the storage. If there already is a node at $destAbsPath, the transport may merge nodes as described in the WorkspaceInterface::copy documentation.
See also: WorkspaceInterface::copy
public copyNode ( string $srcAbsPath, string $destAbsPath, string $srcWorkspace = null )
$srcAbsPath string Absolute source path to the node
$destAbsPath string Absolute destination path including the new node name
$srcWorkspace string The workspace where the source node can be found or null for current workspace

deleteNodeImmediately() public method

Deletes a node and the whole subtree under it outside of a transaction
See also: Workspace::removeItem
public deleteNodeImmediately ( string $path )
$path string Absolute path to the node

deleteNodes() public method

Take care that cyclic REFERENCE properties of to be deleted nodes do not lead to errors.
public deleteNodes ( array $operations )
$operations array

deleteProperties() public method

Perform a batch remove operation.
public deleteProperties ( array $operations )
$operations array

deletePropertyImmediately() public method

Deletes a property outside of a transaction
See also: Workspace::removeItem
public deletePropertyImmediately ( string $path )
$path string Absolute path to the property

finishSave() public method

Called after everything internally is done in the save() method so the transport has a chance to do final stuff (or commit everything at once).
public finishSave ( )

moveNodeImmediately() public method

Moves a node from src to dst outside of a transaction
See also: Workspace::moveNode
public moveNodeImmediately ( string $srcAbsPath, string $dstAbsPath )
$srcAbsPath string Absolute source path to the node
$dstAbsPath string Absolute destination path (must NOT include the new node name)

moveNodes() public method

Perform a batch of move operations in the order of the passed array
public moveNodes ( array $operations )
$operations array

prepareSave() public method

Called before any data is written.
public prepareSave ( )

registerNamespace() public method

Validation based on what was returned from getNamespaces has already happened in the NamespaceRegistry. The transport is however responsible of removing an existing prefix for that uri, if one exists. As well as removing the current uri mapped to this prefix if this prefix is already existing.
public registerNamespace ( string $prefix, string $uri )
$prefix string The prefix to be mapped.
$uri string The URI to be mapped.

reorderChildren() public method

You can either get the reordering list with getOrderCommands or use getNodeNames to get the absolute order.
public reorderChildren ( Node $node )
$node Jackalope\Node the node to reorder its children

rollbackSave() public method

Called if a save operation caused an exception.
public rollbackSave ( )

storeNodes() public method

Transport stores the node at its path, with all properties (but do not store children). The transport is responsible to ensure that the node is valid and has to generate autocreated properties. Note: Nodes in the log may be deleted if they are deleted. The delete request will be passed later, according to the log. You should still create it here as it might be used temporarily in move operations or such. Use Node::getPropertiesForStoreDeletedNode in that case to avoid a status check of the deleted node.
See also: BaseTransport::validateNode
public storeNodes ( array $operations )
$operations array the operations containing the nodes to store

unregisterNamespace() public method

Validation based on what was returned from getNamespaces has already happened in the NamespaceRegistry.
public unregisterNamespace ( string $prefix )
$prefix string The prefix to unregister.

updateNode() public method

Update a node and its children to match its corresponding node in the specified workspace
public updateNode ( Node $node, string $srcWorkspace )
$node Jackalope\Node the node to update
$srcWorkspace string The workspace where the corresponding source node can be found

updateProperties() public method

Update the properties of a node
public updateProperties ( Node $node )
$node Jackalope\Node the node to update