Свойство | Type | Description | |
---|---|---|---|
$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 | Keys are the full paths of properties to be removed. | ||
$session | PHPCR\SessionInterface | ||
$transport | Jackalope\Transport\TransportInterface |
Méthode | Description | |
---|---|---|
__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 | |
Get the nodes identified by the given UUIDs. | |
getNodesByPath ( array $absPaths, string $class = 'Node', array | null $typeFilter = null ) : |
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. |
Méthode | Description | |
---|---|---|
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. |
Méthode | Description | |
---|---|---|
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. |
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 |
public beginTransaction ( ) |
protected cascadeDelete ( string $absPath, boolean $sessionOperation = true ) | ||
$absPath | string | parent node that was removed |
$sessionOperation | boolean | to carry over the session operation information |
protected cascadeDeleteVersion ( string $absPath ) | ||
$absPath | string | parent version node that was removed |
public checkout ( $absPath ) |
public clear ( ) |
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 |
public commitTransaction ( ) |
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. |
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 |
protected executeOperations ( array $operations ) | ||
$operations | array |
public getBinaryStream ( string $path ) : resource | ||
$path | string | The absolute path to the stream |
Résultat | resource |
public getCachedDescendants ( string $absPath, string $class = 'Node' ) : ArrayIterato\ArrayIterator | ||
$absPath | string | |
$class | string | |
Résultat | ArrayIterato\ArrayIterator |
public getCachedNode ( string $absPath, $class = 'Node' ) : PHPCR\NodeInterface | ||
$absPath | string | the absolute path to the node to fetch from cache |
Résultat | PHPCR\NodeInterface | or null |
public getCachedNodeByUuid ( $uuid, string $class = 'Node' ) : PHPCR\NodeInterface | ||
$uuid | ||
$class | string | |
Résultat | PHPCR\NodeInterface | or null |
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 |
Résultat | PHPCR\NodeInterface | The specified Node. if not available, ItemNotFoundException is thrown |
public getNodeByIdentifier ( string $identifier, string $class = 'Node' ) : PHPCR\NodeInterface | ||
$identifier | string | uuid |
$class | string | optional class name for factory |
Résultat | PHPCR\NodeInterface | The specified Node. if not available, ItemNotFoundException is thrown |
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 |
Résultat | PHPCR\NodeInterface |
protected getNodePath ( string $absPath ) : array | ||
$absPath | string | |
Résultat | array | with name, node path |
public getNodeType ( string $nodeType ) : DOMDocument | ||
$nodeType | string | the name of nodetype to get from the transport |
Résultat | DOMDocument | containing the nodetype information |
public getNodeTypes ( array $nodeTypes = [] ) : array | DOMDocument | ||
$nodeTypes | array | Empty for all or specify node types by name |
Résultat | array | DOMDocument | containing the nodetype information |
public getNodesByIdentifier ( array $identifiers, string $class = 'Node' ) : ArrayIterato\ArrayIterator | |
||
$identifiers | array | UUIDs of nodes to retrieve. |
$class | string | Optional class name for the factory. |
Résultat | ArrayIterato\ArrayIterator | |
Iterator of the specified nodes keyed by their unique ids |
public getNodesByPath ( array $absPaths, string $class = 'Node', array | null $typeFilter = null ) : |
||
$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 |
Résultat | Iterator that contains all found NodeInterface instances keyed by their path |
public getNodesByPathAsArray ( $paths, $class = 'Node', $typeFilter = null ) |
public getPermissions ( string $absPath ) : array | ||
$absPath | string | absolute path to node to get permissions for it |
Résultat | array | of string |
public getPropertiesByPath ( $absPaths ) : ArrayIterato\ArrayIterator | ||
$absPaths | ||
Résultat | ArrayIterato\ArrayIterator | that contains all found PropertyInterface instances keyed by their path |
public getPropertyByPath ( string $absPath ) : PHPCR\PropertyInterface | ||
$absPath | string | The absolute path of the property to create. |
Résultat | PHPCR\PropertyInterface |
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 |
Résultat | ArrayIterato\ArrayIterator |
public getTransport ( ) : Jackalope\Transport\TransportInterface | ||
Résultat | Jackalope\Transport\TransportInterface |
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 |
Résultat | ArrayIterato\ArrayIterator |
public hasPendingChanges ( ) : boolean | ||
Résultat | boolean | true if this session has any pending changes. |
public isNodeDeleted ( string $absPath ) : boolean | ||
$absPath | string | The absolute path of the node |
Résultat | boolean | true if the current changed state has no node at this place |
public isNodeMoved ( string $absPath ) : boolean | ||
$absPath | string | The absolute path of the node |
Résultat | boolean | true if the node has an unsaved move operation, false otherwise |
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. |
protected notifyItems ( string $method ) | ||
$method | string | The method to call on each item for the notification (must be beginTransaction, commitTransaction or rollbackTransaction) |
protected pathArrayToPropertiesIterator ( array $propertyPaths ) : ArrayIterato\ArrayIterator | ||
$propertyPaths | array | an array of properties paths |
Résultat | ArrayIterato\ArrayIterator |
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 |
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 |
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 |
Résultat | boolean | true if the node is to be forgotten by its parent (deleted or moved away), false if child should be kept |
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 |
Résultat | boolean | Iterator | true on success or \Iterator over the registered node types if repository is not able to process CND directly |
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. |
public removeItemImmediately ( string $absPath ) | ||
$absPath | string | the absolute path of the item to be removed |
public removeVersion ( string $versionPath, string $versionName ) | ||
$versionPath | string | The path to the version node |
$versionName | string | The name of the version to remove |
protected rewriteItemPaths ( string $curPath, string $newPath ) | ||
$curPath | string | Absolute path of the node to rewrite |
$newPath | string | The new absolute path |
public rollbackTransaction ( ) |
public save ( ) |
protected FactoryInterface,jackalope $factory | ||
Résultat | jackalope\FactoryInterface |
protected AddNodeOperation[],Jackalope\Transport $nodesAdd | ||
Résultat | Jackalope\Transport\AddNodeOperation[] |
protected MoveNodeOperation[],Jackalope\Transport $nodesMove | ||
Résultat | Jackalope\Transport\MoveNodeOperation[] |
protected RemoveNodeOperation[],Jackalope\Transport $nodesRemove | ||
Résultat | Jackalope\Transport\RemoveNodeOperation[] |
protected array $objectsByPath | ||
Résultat | array |
protected array $objectsByUuid | ||
Résultat | array |
protected Operation[],Jackalope\Transport $operationsLog | ||
Résultat | Jackalope\Transport\Operation[] |
protected RemovePropertyOperation[],Jackalope\Transport $propertiesRemove | ||
Résultat |
protected SessionInterface,PHPCR $session | ||
Résultat | PHPCR\SessionInterface |