PHP Класс Jackalope\ObjectManager

For write operations, the object manager acts as the Unit of Work handler: it keeps track which nodes are dirty and updates them with the transport interface.
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$factory jackalope\FactoryInterface The factory to instantiate objects
$nodesAdd Jackalope\Transport\AddNodeOperation[] Keys are the full paths to be added
$nodesMove Jackalope\Transport\MoveNodeOperation[] Keys are the source paths, values the move operations containing the target path. The objectsByPath array is updated immediately and any getItem and similar requests are rewritten for the transport layer until save() Only nodes can be moved, not properties. Note: Keep in mind that moving also affects all children of the moved node, but we only have the explicitly moved paths in this array. We check on moved parents whenever retrieving a non-cached node.
$nodesRemove Jackalope\Transport\RemoveNodeOperation[] Keys are the full paths to be removed. Note: Keep in mind that a delete is recursive, but we only have the explicitly deleted paths in this array. We check on deleted parents whenever retrieving a non-cached node.
$objectsByPath array There is no notion of order here. The order is defined by order in the Node::nodes array.
$objectsByUuid array Take care never to put a path in here unless there is a node for that path in objectsByPath.
$operationsLog Jackalope\Transport\Operation[] Add, remove and move actions need to be saved in the correct order to avoid i.e. adding something where a node has not yet been moved to.
$propertiesRemove Jackalope\Transport\RemovePropertyOperation[] Keys are the full paths of properties to be removed.
$session PHPCR\SessionInterface
$transport Jackalope\Transport\TransportInterface

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

Метод Описание
__construct ( jackalope\FactoryInterface $factory, Jackalope\Transport\TransportInterface $transport, PHPCR\SessionInterface $session ) Create the ObjectManager instance with associated session and transport
addNode ( string $absPath, PHPCR\NodeInterface $node ) WRITE: add a node at the specified path. Schedules an add operation for the next save() and caches the node.
addVersionLabel ( $path, $label, $moveLabel )
beginTransaction ( ) Begin new transaction associated with current session.
checkin ( string $absPath ) : PHPCR\Version\VersionInterface Removes the cache of the predecessor version after the node has been checked in.
checkout ( $absPath ) Removes the cache of the predecessor version after the node has been checked in.
clear ( ) Clears the state of the current session
cloneFromImmediately ( string $srcWorkspace, string $srcAbsPath, string $destAbsPath, boolean $removeExisting ) Implement the workspace clone method. It is dispatched immediately.
commitTransaction ( ) Complete the transaction associated with the current session.
copyNodeImmediately ( string $srcAbsPath, string $destAbsPath, string $srcWorkspace ) Implement the workspace copy method. It is dispatched immediately.
filterChildNodeNamesByType ( PHPCR\NodeInterface $node, string | array $nameFilter, string | array $typeFilter ) : ArrayIterato\ArrayIterator This method will either let the transport filter if that is possible or forward to getNodes and return the names of the nodes found there.,
getBinaryStream ( string $path ) : resource Retrieves the stream for a binary value.
getCachedDescendants ( string $absPath, string $class = 'Node' ) : ArrayIterato\ArrayIterator Return an ArrayIterator containing all the cached children of the given node.
getCachedNode ( string $absPath, $class = 'Node' ) : PHPCR\NodeInterface Get a node if it is already in cache or null otherwise.
getCachedNodeByUuid ( $uuid, string $class = 'Node' ) : PHPCR\NodeInterface Get a node if it is already in cache or null otherwise.
getNode ( string $relPath, string $context, string $class = 'Node' ) : PHPCR\NodeInterface Get the node identified by a relative path.
getNodeByIdentifier ( string $identifier, string $class = 'Node' ) : PHPCR\NodeInterface Get the node identified by an uuid.
getNodeByPath ( string $absPath, string $class = 'Node', object $object = null ) : PHPCR\NodeInterface Get the node identified by an absolute path.
getNodeType ( string $nodeType ) : DOMDocument Get a single nodetype.
getNodeTypes ( array $nodeTypes = [] ) : array | DOMDocument Returns the node types specified by name in the array or all types if no filter is given.
getNodesByIdentifier ( array $identifiers, string $class = 'Node' ) : ArrayIterato\ArrayIterator | Node[] Get the nodes identified by the given UUIDs.
getNodesByPath ( array $absPaths, string $class = 'Node', array | null $typeFilter = null ) : Node[] Get multiple nodes identified by an absolute paths. Missing nodes are ignored.
getNodesByPathAsArray ( $paths, $class = 'Node', $typeFilter = null )
getPermissions ( string $absPath ) : array Return the permissions of the current session on the node given by path.
getPropertiesByPath ( $absPaths ) : ArrayIterato\ArrayIterator Get all nodes of those properties in one batch, then collect the properties of them.
getPropertyByPath ( string $absPath ) : PHPCR\PropertyInterface Get the property identified by an absolute path.
getReferences ( string $path, string $name = null ) : ArrayIterato\ArrayIterator Returns all accessible REFERENCE properties in the workspace that point to the node
getTransport ( ) : Jackalope\Transport\TransportInterface Implementation specific: Transport is used elsewhere, provide it here for Session
getWeakReferences ( string $path, string $name = null ) : ArrayIterato\ArrayIterator Returns all accessible WEAKREFERENCE properties in the workspace that point to the node
hasPendingChanges ( ) : boolean Determine if any object is modified and not saved to storage.
isNodeDeleted ( string $absPath ) : boolean Check whether the node at path has an unpersisted delete operation and there is no other node moved or added there.
isNodeMoved ( string $absPath ) : boolean Check whether a node path has an unpersisted move operation.
moveNode ( string $srcAbsPath, string $destAbsPath ) WRITE: move node from source path to destination path
moveNodeImmediately ( string $srcAbsPath, string $destAbsPath ) Implement the workspace move method. It is dispatched to transport immediately.
purgeDisappearedNode ( string $absPath, boolean $keepChanges ) : boolean Purge an item given by path from the cache and return whether the node should forget it or keep it.
refresh ( boolean $keepChanges ) Refresh cached items from the backend.
registerNodeTypes ( array $types, boolean $allowUpdate ) : boolean Register node types with the backend.
registerNodeTypesCnd ( string $cnd, boolean $allowUpdate ) : boolean | Iterator Register node types with compact node definition format
removeItem ( string $absPath, PHPCR\PropertyInterface $property = null ) Remove a node or a property.
removeItemImmediately ( string $absPath ) Implement the workspace removeItem method.
removeVersion ( string $versionPath, string $versionName ) Remove a version given the path to the version node and the version name.
removeVersionLabel ( $path, $label )
restore ( boolean $removeExisting, string $versionPath, string $nodePath ) Restore the node at $nodePath to the version at $versionPath
rollbackTransaction ( ) Roll back the transaction associated with the current session.
save ( ) Push all recorded changes to the backend.

Защищенные методы

Метод Описание
cascadeDelete ( string $absPath, boolean $sessionOperation = true ) Notify all cached children that they are deleted as well and clean up internal state
cascadeDeleteVersion ( string $absPath ) Notify all cached version children that they are deleted as well and clean up internal state
executeBatch ( integer $type, Jackalope\Transport\Operation[] $operations ) Execute a batch of operations of one type.
executeOperations ( array $operations ) Execute the recorded operations in the right order, skipping stale data.
getFetchPath ( string $absPath, string $class ) : string Resolve the path through all pending operations and sanity check while doing this.
getNodePath ( string $absPath ) : array Get the node path for a property, and the property name
notifyItems ( string $method ) Notifies the given node and all of its children and properties that a transaction has begun, was committed or rolled back so that the item has a chance to save or restore his internal state.
pathArrayToPropertiesIterator ( array $propertyPaths ) : ArrayIterato\ArrayIterator Transform an array containing properties paths to an ArrayIterator over Property objects
performNodeRemove ( string $absPath, PHPCR\NodeInterface $node, boolean $sessionOperation = true, $cascading = false ) Remove the item at absPath from local cache and keep information for undo.
performPropertyRemove ( string $absPath, PHPCR\PropertyInterface $property, boolean $sessionOperation = true ) Remove the item at absPath from local cache and keep information for undo.
rewriteItemPaths ( string $curPath, string $newPath ) Rewrites the path of a node for the movement operation, also updating all cached children.

Приватные методы

Метод Описание
getMoveSrcPath ( string $dstPath ) : string | boolean Get the src path of a move operation knowing the target path.
matchNodeType ( PHPCR\NodeInterface $node, array $typeFilter ) : boolean Check if a node is of any of the types listed in typeFilter.

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

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

Create the ObjectManager instance with associated session and transport
public __construct ( jackalope\FactoryInterface $factory, Jackalope\Transport\TransportInterface $transport, PHPCR\SessionInterface $session )
$factory jackalope\FactoryInterface the object factory
$transport Jackalope\Transport\TransportInterface
$session PHPCR\SessionInterface

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

WRITE: add a node at the specified path. Schedules an add operation for the next save() and caches the node.
public addNode ( string $absPath, PHPCR\NodeInterface $node )
$absPath string the path to the node or property, including the item name
$node PHPCR\NodeInterface The item instance that is added.

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

См. также: VersioningInterface::addVersionLabel
public addVersionLabel ( $path, $label, $moveLabel )

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

Begin new transaction associated with current session.
public beginTransaction ( )

cascadeDelete() защищенный Метод

Notify all cached children that they are deleted as well and clean up internal state
protected cascadeDelete ( string $absPath, boolean $sessionOperation = true )
$absPath string parent node that was removed
$sessionOperation boolean to carry over the session operation information

cascadeDeleteVersion() защищенный Метод

Notify all cached version children that they are deleted as well and clean up internal state
protected cascadeDeleteVersion ( string $absPath )
$absPath string parent version node that was removed

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

TODO: document more clearly
См. также: VersionManager::checkin
public checkin ( string $absPath ) : PHPCR\Version\VersionInterface
$absPath string
Результат PHPCR\Version\VersionInterface node version

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

TODO: document more clearly. This looks like copy-paste from checkin
См. также: VersionManager::checkout
public checkout ( $absPath )

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

Removes all cached objects, planned changes etc. Mostly useful for testing purposes.
Устаревший: : this will screw up major, as the user of the api can still have references to nodes. USE refresh instead!
public clear ( )

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

http://www.day.com/specs/jcr/2.0/3_Repository_Model.html#3.10%20Corresponding%20Nodes http://www.day.com/specs/jcr/2.0/10_Writing.html#10.8%20Cloning%20and%20Updating%20Nodes
См. также: Workspace::cloneFrom()
public cloneFromImmediately ( string $srcWorkspace, string $srcAbsPath, string $destAbsPath, boolean $removeExisting )
$srcWorkspace string the name of the workspace from which the copy is to be made.
$srcAbsPath string the path of the node to be cloned.
$destAbsPath string the location to which the node at srcAbsPath is to be cloned in this workspace.
$removeExisting boolean

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

TODO: Make sure RollbackException and AccessDeniedException are thrown by the transport if corresponding problems occur.
public commitTransaction ( )

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

Implement the workspace copy method. It is dispatched immediately.
См. также: Workspace::copy()
public copyNodeImmediately ( string $srcAbsPath, string $destAbsPath, string $srcWorkspace )
$srcAbsPath string the path of the node to be copied.
$destAbsPath string the location to which the node at srcAbsPath is to be copied in this workspace.
$srcWorkspace string the name of the workspace from which the copy is to be made.

executeBatch() защищенный Метод

Execute a batch of operations of one type.
protected executeBatch ( integer $type, Jackalope\Transport\Operation[] $operations )
$type integer type of the operations to be executed
$operations Jackalope\Transport\Operation[] list of same type operations

executeOperations() защищенный Метод

Execute the recorded operations in the right order, skipping stale data.
protected executeOperations ( array $operations )
$operations array

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

This method will either let the transport filter if that is possible or forward to getNodes and return the names of the nodes found there.,
public filterChildNodeNamesByType ( PHPCR\NodeInterface $node, string | array $nameFilter, string | array $typeFilter ) : ArrayIterato\ArrayIterator
$node PHPCR\NodeInterface
$nameFilter string | array
$typeFilter string | array
Результат ArrayIterato\ArrayIterator

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

Retrieves the stream for a binary value.
public getBinaryStream ( string $path ) : resource
$path string The absolute path to the stream
Результат resource

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

It makes no difference whether or not the node itself is cached. Note that this method will also return deleted node objects so you can use them in refresh operations.
public getCachedDescendants ( string $absPath, string $class = 'Node' ) : ArrayIterato\ArrayIterator
$absPath string
$class string
Результат ArrayIterato\ArrayIterator

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

Note that this method will also return deleted node objects so you can use them in refresh operations.
См. также: Node::refresh()
public getCachedNode ( string $absPath, $class = 'Node' ) : PHPCR\NodeInterface
$absPath string the absolute path to the node to fetch from cache
Результат PHPCR\NodeInterface or null

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

As getCachedNode but looking up the node by uuid. Note that this will never return you a removed node because the uuid is removed from the map.
См. также: getCachedNode
public getCachedNodeByUuid ( $uuid, string $class = 'Node' ) : PHPCR\NodeInterface
$uuid
$class string
Результат PHPCR\NodeInterface or null

getFetchPath() защищенный Метод

Resolve the path through all pending operations and sanity check while doing this.
protected getFetchPath ( string $absPath, string $class ) : string
$absPath string The absolute path of the node to fetch.
$class string The class of node to get. TODO: Is it sane to fetch data separately for Version and normal Node?
Результат string fetch path

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

If you have an absolute path use {@link getNodeByPath()} for better performance.
См. также: Session::getNode()
public getNode ( string $relPath, string $context, string $class = 'Node' ) : PHPCR\NodeInterface
$relPath string relative path
$context string context path
$class string optional class name for the factory
Результат PHPCR\NodeInterface The specified Node. if not available, ItemNotFoundException is thrown

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

Get the node identified by an uuid.
См. также: Session::getNodeByIdentifier()
public getNodeByIdentifier ( string $identifier, string $class = 'Node' ) : PHPCR\NodeInterface
$identifier string uuid
$class string optional class name for factory
Результат PHPCR\NodeInterface The specified Node. if not available, ItemNotFoundException is thrown

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

To prevent unnecessary work to be done a cache is filled to only fetch nodes once. To reset a node with the data from the backend, use Node::refresh() Uses the factory to create a Node object.
См. также: Session::getNode()
public getNodeByPath ( string $absPath, string $class = 'Node', object $object = null ) : PHPCR\NodeInterface
$absPath string The absolute path of the node to fetch.
$class string The class of node to get. TODO: Is it sane to fetch data separately for Version and normal Node?
$object object A (prefetched) object (de-serialized json) from the backend only to be used if we get child nodes in one backend call
Результат PHPCR\NodeInterface

getNodePath() защищенный Метод

Get the node path for a property, and the property name
protected getNodePath ( string $absPath ) : array
$absPath string
Результат array with name, node path

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

Get a single nodetype.
См. также: getNodeTypes()
public getNodeType ( string $nodeType ) : DOMDocument
$nodeType string the name of nodetype to get from the transport
Результат DOMDocument containing the nodetype information

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

This is only a proxy to the transport
public getNodeTypes ( array $nodeTypes = [] ) : array | DOMDocument
$nodeTypes array Empty for all or specify node types by name
Результат array | DOMDocument containing the nodetype information

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

Note UUIDs that are not found will be ignored. Also, duplicate IDs will be eliminated by nature of using the IDs as keys.
См. также: Session::getNodesByIdentifier()
public getNodesByIdentifier ( array $identifiers, string $class = 'Node' ) : ArrayIterato\ArrayIterator | Node[]
$identifiers array UUIDs of nodes to retrieve.
$class string Optional class name for the factory.
Результат ArrayIterato\ArrayIterator | Node[] Iterator of the specified nodes keyed by their unique ids

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

Note paths that cannot be found will be ignored and missing from the result. Uses the factory to create Node objects.
См. также: Session::getNodes()
public getNodesByPath ( array $absPaths, string $class = 'Node', array | null $typeFilter = null ) : Node[]
$absPaths array Array containing the absolute paths of the nodes to fetch.
$class string The class of node to get. TODO: Is it sane to fetch data separately for Version and normal Node?
$typeFilter array | null Node type list to skip some nodes
Результат Node[] Iterator that contains all found NodeInterface instances keyed by their path

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

public getNodesByPathAsArray ( $paths, $class = 'Node', $typeFilter = null )

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

Permission can be of 4 types: - add_node - read - remove - set_property This function will return an array containing zero, one or more of the above strings.
public getPermissions ( string $absPath ) : array
$absPath string absolute path to node to get permissions for it
Результат array of string

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

Get all nodes of those properties in one batch, then collect the properties of them.
public getPropertiesByPath ( $absPaths ) : ArrayIterato\ArrayIterator
$absPaths
Результат ArrayIterato\ArrayIterator that contains all found PropertyInterface instances keyed by their path

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

Uses the factory to instantiate a Property. Currently Jackalope just loads the containing node and then returns the requested property of the node instance.
public getPropertyByPath ( string $absPath ) : PHPCR\PropertyInterface
$absPath string The absolute path of the property to create.
Результат PHPCR\PropertyInterface

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

Returns all accessible REFERENCE properties in the workspace that point to the node
См. также: Node::getReferences()
public getReferences ( string $path, string $name = null ) : ArrayIterato\ArrayIterator
$path string the path of the referenced node
$name string name of referring REFERENCE properties to be returned; if null then all referring REFERENCEs are returned
Результат ArrayIterato\ArrayIterator

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

Implementation specific: Transport is used elsewhere, provide it here for Session
public getTransport ( ) : Jackalope\Transport\TransportInterface
Результат Jackalope\Transport\TransportInterface

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

Returns all accessible WEAKREFERENCE properties in the workspace that point to the node
См. также: Node::getWeakReferences()
public getWeakReferences ( string $path, string $name = null ) : ArrayIterato\ArrayIterator
$path string the path of the referenced node
$name string name of referring WEAKREFERENCE properties to be returned; if null then all referring WEAKREFERENCEs are returned
Результат ArrayIterato\ArrayIterator

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

Determine if any object is modified and not saved to storage.
См. также: Session::hasPendingChanges()
public hasPendingChanges ( ) : boolean
Результат boolean true if this session has any pending changes.

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

This is a simplistic check to be used by the Node to determine if it should not show one of the children the backend told it would exist.
См. также: Node::__construct
public isNodeDeleted ( string $absPath ) : boolean
$absPath string The absolute path of the node
Результат boolean true if the current changed state has no node at this place

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

This is a simplistic check to be used by the Node to determine if it should not show one of the children the backend told it would exist.
См. также: Node::__construct
public isNodeMoved ( string $absPath ) : boolean
$absPath string The absolute path of the node
Результат boolean true if the node has an unsaved move operation, false otherwise

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

WRITE: move node from source path to destination path
См. также: Session::move()
public moveNode ( string $srcAbsPath, string $destAbsPath )
$srcAbsPath string Absolute path to the source node.
$destAbsPath string Absolute path to the destination where the node shall be moved to.

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

Implement the workspace move method. It is dispatched to transport immediately.
См. также: Workspace::move()
public moveNodeImmediately ( string $srcAbsPath, string $destAbsPath )
$srcAbsPath string the path of the node to be moved.
$destAbsPath string the location to which the node at srcAbsPath is to be moved.

notifyItems() защищенный Метод

Notifies the given node and all of its children and properties that a transaction has begun, was committed or rolled back so that the item has a chance to save or restore his internal state.
protected notifyItems ( string $method )
$method string The method to call on each item for the notification (must be beginTransaction, commitTransaction or rollbackTransaction)

pathArrayToPropertiesIterator() защищенный Метод

Transform an array containing properties paths to an ArrayIterator over Property objects
protected pathArrayToPropertiesIterator ( array $propertyPaths ) : ArrayIterato\ArrayIterator
$propertyPaths array an array of properties paths
Результат ArrayIterato\ArrayIterator

performNodeRemove() защищенный Метод

Remove the item at absPath from local cache and keep information for undo.
См. также: ObjectManager::removeItem()
protected performNodeRemove ( string $absPath, PHPCR\NodeInterface $node, boolean $sessionOperation = true, $cascading = false )
$absPath string The absolute path of the item that is being removed. Note that contrary to removeItem(), this path is the full path for a property too.
$node PHPCR\NodeInterface The item that is being removed
$sessionOperation boolean whether the node removal should be dispatched immediately or needs to be scheduled in the operations log

performPropertyRemove() защищенный Метод

Remove the item at absPath from local cache and keep information for undo.
См. также: ObjectManager::removeItem()
protected performPropertyRemove ( string $absPath, PHPCR\PropertyInterface $property, boolean $sessionOperation = true )
$absPath string The absolute path of the item that is being removed. Note that contrary to removeItem(), this path is the full path for a property too.
$property PHPCR\PropertyInterface The item that is being removed
$sessionOperation boolean whether the property removal should be dispatched immediately or needs to be scheduled in the operations log

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

This is used by Node::refresh() to let the object manager notify deleted nodes or detect cases when not to delete.
public purgeDisappearedNode ( string $absPath, boolean $keepChanges ) : boolean
$absPath string The absolute path of the item
$keepChanges boolean Whether to keep local changes or forget them
Результат boolean true if the node is to be forgotten by its parent (deleted or moved away), false if child should be kept

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

Refresh cached items from the backend.
См. также: Session::refresh()
public refresh ( boolean $keepChanges )
$keepChanges boolean whether to keep local changes or discard them.

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

This is only a proxy to the transport
public registerNodeTypes ( array $types, boolean $allowUpdate ) : boolean
$types array an array of NodeTypeDefinitions
$allowUpdate boolean whether to fail if node already exists or to update it
Результат boolean true on success

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

This is only a proxy to the transport
См. также: NodeTypeManagerInterface::registerNodeTypesCnd
public registerNodeTypesCnd ( string $cnd, boolean $allowUpdate ) : boolean | Iterator
$cnd string a string with cnd information
$allowUpdate boolean whether to fail if node already exists or to update it
Результат boolean | Iterator true on success or \Iterator over the registered node types if repository is not able to process CND directly

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

If this is a node, sets all cached items below this node to deleted as well. If property is set, the path denotes the node containing the property, otherwise the node at path is removed.
См. также: Item::remove()
public removeItem ( string $absPath, PHPCR\PropertyInterface $property = null )
$absPath string The absolute path to the node to be removed, including the node name.
$property PHPCR\PropertyInterface optional, property instance to delete from the given node path. If set, absPath is the path to the node containing this property.

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

Implement the workspace removeItem method.
См. также: Workspace::removeItem
public removeItemImmediately ( string $absPath )
$absPath string the absolute path of the item to be removed

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

Remove a version given the path to the version node and the version name.
public removeVersion ( string $versionPath, string $versionName )
$versionPath string The path to the version node
$versionName string The name of the version to remove

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

См. также: VersioningInterface::addVersionLabel
public removeVersionLabel ( $path, $label )

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

Clears the node's cache after it has been restored. TODO: This is incomplete. Needs batch processing to implement restoring an array of versions
public restore ( boolean $removeExisting, string $versionPath, string $nodePath )
$removeExisting boolean whether to remove the existing current version or create a new version after that version
$versionPath string
$nodePath string absolute path to the node

rewriteItemPaths() защищенный Метод

This applies both to the cache and to the items themselves so they return the correct value on getPath calls.
protected rewriteItemPaths ( string $curPath, string $newPath )
$curPath string Absolute path of the node to rewrite
$newPath string The new absolute path

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

TODO: Make sure AccessDeniedException is thrown by the transport if corresponding problems occur TODO: restore the in-memory state as it would be if save() was never called during the transaction. The save() method will need to track some undo information for this to be possible.
public rollbackTransaction ( )

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

The order is important to avoid conflicts 1. operationsLog 2. commit any other changes If transactions are enabled but we are not currently inside a transaction, the session is responsible to start a transaction to make sure the backend state does not get messed up in case of error.
public save ( )

Описание свойств

$factory защищенное свойство

The factory to instantiate objects
protected FactoryInterface,jackalope $factory
Результат jackalope\FactoryInterface

$nodesAdd защищенное свойство

Keys are the full paths to be added
protected AddNodeOperation[],Jackalope\Transport $nodesAdd
Результат Jackalope\Transport\AddNodeOperation[]

$nodesMove защищенное свойство

Keys are the source paths, values the move operations containing the target path. The objectsByPath array is updated immediately and any getItem and similar requests are rewritten for the transport layer until save() Only nodes can be moved, not properties. Note: Keep in mind that moving also affects all children of the moved node, but we only have the explicitly moved paths in this array. We check on moved parents whenever retrieving a non-cached node.
protected MoveNodeOperation[],Jackalope\Transport $nodesMove
Результат Jackalope\Transport\MoveNodeOperation[]

$nodesRemove защищенное свойство

Keys are the full paths to be removed. Note: Keep in mind that a delete is recursive, but we only have the explicitly deleted paths in this array. We check on deleted parents whenever retrieving a non-cached node.
protected RemoveNodeOperation[],Jackalope\Transport $nodesRemove
Результат Jackalope\Transport\RemoveNodeOperation[]

$objectsByPath защищенное свойство

There is no notion of order here. The order is defined by order in the Node::nodes array.
protected array $objectsByPath
Результат array

$objectsByUuid защищенное свойство

Take care never to put a path in here unless there is a node for that path in objectsByPath.
protected array $objectsByUuid
Результат array

$operationsLog защищенное свойство

Add, remove and move actions need to be saved in the correct order to avoid i.e. adding something where a node has not yet been moved to.
protected Operation[],Jackalope\Transport $operationsLog
Результат Jackalope\Transport\Operation[]

$propertiesRemove защищенное свойство

Keys are the full paths of properties to be removed.
protected RemovePropertyOperation[],Jackalope\Transport $propertiesRemove
Результат Jackalope\Transport\RemovePropertyOperation[]

$session защищенное свойство

protected SessionInterface,PHPCR $session
Результат PHPCR\SessionInterface

$transport защищенное свойство

protected TransportInterface,Jackalope\Transport $transport
Результат Jackalope\Transport\TransportInterface