PHP Интерфейс 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.
Наследование: extends Jackalope\Transport\TransportInterface
Показать файл Открыть проект Примеры использования интерфейса

Открытые методы

Метод Описание
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

Описание методов

assertValidName() публичный Метод

Note: There is a minimal implementation in BaseTransport
См. также: 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
Результат boolean always true, if the name is not valid a RepositoryException is thrown

cloneFrom() публичный Метод

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.
См. также: 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() публичный Метод

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.
См. также: 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() публичный Метод

Deletes a node and the whole subtree under it outside of a transaction
См. также: Workspace::removeItem
public deleteNodeImmediately ( string $path )
$path string Absolute path to the node

deleteNodes() публичный Метод

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

deleteProperties() публичный Метод

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

deletePropertyImmediately() публичный Метод

Deletes a property outside of a transaction
См. также: Workspace::removeItem
public deletePropertyImmediately ( string $path )
$path string Absolute path to the property

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).
public finishSave ( )

moveNodeImmediately() публичный Метод

Moves a node from src to dst outside of a transaction
См. также: 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() публичный Метод

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

prepareSave() публичный Метод

Called before any data is written.
public prepareSave ( )

registerNamespace() публичный Метод

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() публичный Метод

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() публичный Метод

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

storeNodes() публичный Метод

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.
См. также: BaseTransport::validateNode
public storeNodes ( array $operations )
$operations array the operations containing the nodes to store

unregisterNamespace() публичный Метод

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() публичный Метод

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() публичный Метод

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