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.
파일 보기 프로젝트 열기: jackalope/jackalope 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$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