PHP 클래스 Jackalope\Node

You can iterate over the nodes children because it is an IteratorAggregate
상속: extends Item, implements IteratorAggregat\IteratorAggregate, implements PHPCR\NodeInterface
파일 보기 프로젝트 열기: jackalope/jackalope 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$definition PHPCR\NodeType\NodeDefinitionInterface Cached instance of the node definition that defines this node
$deletedProperties this is needed in order to track deletions in case of refresh keys are the property names, values the properties (in state deleted)
$index integer TODO: fully implement same-name siblings
$nodes array ordered list of the child node names
$originalNodesOrder array used to calculate reordering operations if orderBefore() was used
$primaryType string The primary type name of this node
$properties Property[] all properties are instantiated in the constructor OPTIMIZE: lazy instantiate property objects, just have local array of values

공개 메소드들

메소드 설명
__construct ( jackalope\FactoryInterface $factory, array $rawData, string $path, jackalope\Session $session, ObjectManager $objectManager, boolean $new = false ) Create a new node instance with data from the storage layer
addChildNode ( PHPCR\NodeInterface $node, boolean $check, string $name = null ) Adds child node to this node for internal reference
addMixin ( $mixinName ) {@inheritDoc}
addNode ( $relPath, $primaryNodeTypeName = null ) Creates a new node at the specified $relPath
addNodeAutoNamed ( $nameHint = null, $primaryNodeTypeName = null ) {@inheritDoc}
beginTransaction ( ) {@inheritDoc}
canAddMixin ( $mixinName ) {@inheritDoc}
commitTransaction ( ) {@inheritDoc}
confirmSaved ( ) In addition to calling parent method, tell all properties and clean deletedProperties
followLifecycleTransition ( $transition ) {@inheritDoc}
getAllowedLifecycleTransitions ( ) {@inheritDoc}
getCorrespondingNodePath ( $workspaceName ) {@inheritDoc}
getDefinition ( ) {@inheritDoc}
getIdentifier ( ) {@inheritDoc}
getIndex ( ) {@inheritDoc}
getIterator ( ) : Iterator Provide Traversable interface: redirect to getNodes with no filter
getMixinNodeTypes ( ) {@inheritDoc}
getNode ( $relPath ) {@inheritDoc}
getNodeNames ( $nameFilter = null, $typeFilter = null ) {@inheritDoc}
getNodes ( $nameFilter = null, $typeFilter = null ) {@inheritDoc}
getOrderCommands ( ) : array Returns the orderBefore commands to be applied to the childnodes to get from the original order to the new one
getPrimaryItem ( ) {@inheritDoc}
getPrimaryNodeType ( ) {@inheritDoc}
getProperties ( $nameFilter = null ) {@inheritDoc}
getPropertiesForStoreDeletedNode ( ) : Property[] This method is only meant for the transport to be able to still build a store request for afterwards deleted nodes to support the operationslog.
getPropertiesValues ( $nameFilter = null, $dereference = true ) {@inheritDoc}
getProperty ( $relPath ) {@inheritDoc}
getPropertyValue ( $name, $type = null ) {@inheritDoc}
getPropertyValueWithDefault ( $relPath, $defaultValue ) {@inheritDoc}
getReferences ( $name = null ) {@inheritDoc}
getSharedSet ( ) {@inheritDoc}
getWeakReferences ( $name = null ) {@inheritDoc}
hasNode ( $relPath ) {@inheritDoc}
hasNodes ( ) {@inheritDoc}
hasProperties ( ) {@inheritDoc}
hasProperty ( $relPath ) {@inheritDoc}
isCheckedOut ( ) {@inheritDoc}
isLocked ( ) {@inheritDoc}
isNodeType ( $nodeTypeName ) {@inheritDoc}
needsChildReordering ( ) : boolean Determine whether the children of this node need to be reordered
orderBefore ( $srcChildRelPath, $destChildRelPath ) Jackalope implements this feature and updates the position of the existing child at srcChildRelPath to be in the list immediately before destChildRelPath.
remove ( ) Remove this node
removeMixin ( $mixinName ) {@inheritDoc}
removeShare ( ) {@inheritDoc}
removeSharedSet ( ) {@inheritDoc}
rename ( $newName ) {@inheritDoc}
rollbackTransaction ( ) {@inheritDoc}
setChildrenDirty ( ) Mark all cached children as dirty.
setDeleted ( ) In addition to set this item deleted, set all properties to deleted.
setDirty ( $keepChanges = false, $targetState = false ) Overwrite to set the properties dirty as well.
setMixins ( array $mixinNames ) {@inheritDoc}
setPath ( $path, $move = false ) In addition to calling parent method, tell all properties
setPrimaryType ( $nodeTypeName ) Changes the primary node type of this node to nodeTypeName.
setProperty ( $name, $value, $type = PropertyType::UNDEFINED, boolean $validate = true ) {@inheritDoc}
unsetChildNode ( string $name, boolean $check ) Removes the reference in the internal node storage
unsetProperty ( string $name ) Removes the reference in the internal node storage
update ( $srcWorkspace ) {@inheritDoc}

보호된 메소드들

메소드 설명
_setProperty ( string $name, mixed $value, string $type, boolean $internal ) : Property Implement really setting the property without any notification.
filterNames ( string | array $filter, array $names ) : array Filter the list of names according to the filter expression / array
generateUuid ( ) : string
getChildPath ( string $p ) : string Make sure $p is an absolute path
refresh ( $keepChanges, $internal = false ) Refresh this node

비공개 메소드들

메소드 설명
parseData ( array $rawData, boolean $update, boolean $keepChanges = false ) Initialize or update this object with raw data from backend.

메소드 상세

__construct() 공개 메소드

This is only to be called by the Factory::get() method even inside the Jackalope implementation to allow for custom implementations of Nodes.
또한 보기: TransportInterface::getNode()
public __construct ( jackalope\FactoryInterface $factory, array $rawData, string $path, jackalope\Session $session, ObjectManager $objectManager, boolean $new = false )
$factory jackalope\FactoryInterface the object factory
$rawData array in the format as returned from TransportInterface::getNode
$path string the absolute path of this node
$session jackalope\Session
$objectManager ObjectManager
$new boolean set to true if this is a new node being created. Defaults to false which means the node is loaded from storage.

_setProperty() 보호된 메소드

Implement the setProperty, but also used from constructor or in refresh, when the backend has a new property that is not yet loaded in memory.
또한 보기: Node::setProperty
또한 보기: Node::refresh
또한 보기: Node::__construct
protected _setProperty ( string $name, mixed $value, string $type, boolean $internal ) : Property
$name string
$value mixed
$type string
$internal boolean whether we are setting this node through api or internally
리턴 Property

addChildNode() 공개 메소드

Adds child node to this node for internal reference
public addChildNode ( PHPCR\NodeInterface $node, boolean $check, string $name = null )
$node PHPCR\NodeInterface The name of the child node
$check boolean whether to check state
$name string is used in cases where $node->getName would not return the correct name (during move operation)

addMixin() 공개 메소드

Jackalope validates type conflicts only on save, not immediately. It is possible to add mixin types after the first save.
public addMixin ( $mixinName )

addNode() 공개 메소드

{@inheritDoc} In Jackalope, the child node type definition is immediately applied if no primaryNodeTypeName is specified. The PathNotFoundException and ConstraintViolationException are thrown immediately. Version and Lock related exceptions are delayed until save.
public addNode ( $relPath, $primaryNodeTypeName = null )

addNodeAutoNamed() 공개 메소드

{@inheritDoc}
public addNodeAutoNamed ( $nameHint = null, $primaryNodeTypeName = null )

beginTransaction() 공개 메소드

Additionally, notifies all properties of this node. Child nodes are not notified, it is the job of the ObjectManager to know which nodes are cached and notify them.
public beginTransaction ( )

canAddMixin() 공개 메소드

{@inheritDoc}
public canAddMixin ( $mixinName )

commitTransaction() 공개 메소드

Additionally, notifies all properties of this node. Child nodes are not notified, it is the job of the ObjectManager to know which nodes are cached and notify them.
public commitTransaction ( )

confirmSaved() 공개 메소드

In addition to calling parent method, tell all properties and clean deletedProperties
public confirmSaved ( )

filterNames() 보호된 정적인 메소드

Filter the list of names according to the filter expression / array
protected static filterNames ( string | array $filter, array $names ) : array
$filter string | array according to getNodes|getProperties
$names array list of names to filter
리턴 array the names in $names that match the filter

followLifecycleTransition() 공개 메소드

{@inheritDoc}
public followLifecycleTransition ( $transition )

generateUuid() 보호된 메소드

protected generateUuid ( ) : string
리턴 string a universally unique id.

getAllowedLifecycleTransitions() 공개 메소드

{@inheritDoc}

getChildPath() 보호된 메소드

If its a relative path, prepend the path to this node, otherwise return as is
protected getChildPath ( string $p ) : string
$p string the relative or absolute property or node path
리턴 string the absolute path to this item, with relative paths resolved against the current node

getCorrespondingNodePath() 공개 메소드

{@inheritDoc}
public getCorrespondingNodePath ( $workspaceName )

getDefinition() 공개 메소드

{@inheritDoc}
public getDefinition ( )

getIdentifier() 공개 메소드

{@inheritDoc}
public getIdentifier ( )

getIndex() 공개 메소드

{@inheritDoc}
public getIndex ( )

getIterator() 공개 메소드

Provide Traversable interface: redirect to getNodes with no filter
public getIterator ( ) : Iterator
리턴 Iterator over all child nodes

getMixinNodeTypes() 공개 메소드

{@inheritDoc}
public getMixinNodeTypes ( )

getNode() 공개 메소드

{@inheritDoc}
public getNode ( $relPath )

getNodeNames() 공개 메소드

{@inheritDoc}
public getNodeNames ( $nameFilter = null, $typeFilter = null )

getNodes() 공개 메소드

{@inheritDoc}
public getNodes ( $nameFilter = null, $typeFilter = null )

getOrderCommands() 공개 메소드

Returns the orderBefore commands to be applied to the childnodes to get from the original order to the new one
public getOrderCommands ( ) : array
리턴 array of arrays with 2 fields: name of node to order before second name

getPrimaryItem() 공개 메소드

{@inheritDoc}
public getPrimaryItem ( )

getPrimaryNodeType() 공개 메소드

{@inheritDoc}
public getPrimaryNodeType ( )

getProperties() 공개 메소드

{@inheritDoc}
public getProperties ( $nameFilter = null )

getPropertiesForStoreDeletedNode() 공개 메소드

This method is only meant for the transport to be able to still build a store request for afterwards deleted nodes to support the operationslog.
또한 보기: Jackalope\Transport\WritingInterface::storeNodes
public getPropertiesForStoreDeletedNode ( ) : Property[]
리턴 Property[] with just the jcr:primaryType property in it

getPropertiesValues() 공개 메소드

{@inheritDoc}
public getPropertiesValues ( $nameFilter = null, $dereference = true )

getProperty() 공개 메소드

{@inheritDoc}
public getProperty ( $relPath )

getPropertyValue() 공개 메소드

{@inheritDoc}
public getPropertyValue ( $name, $type = null )

getPropertyValueWithDefault() 공개 메소드

{@inheritDoc}
public getPropertyValueWithDefault ( $relPath, $defaultValue )

getReferences() 공개 메소드

{@inheritDoc}
public getReferences ( $name = null )

getSharedSet() 공개 메소드

{@inheritDoc}
public getSharedSet ( )

getWeakReferences() 공개 메소드

{@inheritDoc}
public getWeakReferences ( $name = null )

hasNode() 공개 메소드

{@inheritDoc}
public hasNode ( $relPath )

hasNodes() 공개 메소드

{@inheritDoc}
public hasNodes ( )

hasProperties() 공개 메소드

{@inheritDoc}
public hasProperties ( )

hasProperty() 공개 메소드

{@inheritDoc}
public hasProperty ( $relPath )

isCheckedOut() 공개 메소드

{@inheritDoc}
public isCheckedOut ( )

isLocked() 공개 메소드

{@inheritDoc}
public isLocked ( )

isNodeType() 공개 메소드

{@inheritDoc}
public isNodeType ( $nodeTypeName )

needsChildReordering() 공개 메소드

Determine whether the children of this node need to be reordered
public needsChildReordering ( ) : boolean
리턴 boolean

orderBefore() 공개 메소드

{@inheritDoc} Jackalope has no implementation-specific ordering restriction so no \PHPCR\ConstraintViolationException is expected. VersionException and LockException are not tested immediately but thrown on save.
public orderBefore ( $srcChildRelPath, $destChildRelPath )

refresh() 보호된 메소드

{@inheritDoc} This is also called internally to refresh when the node is accessed in state DIRTY.
또한 보기: Item::checkState
protected refresh ( $keepChanges, $internal = false )

remove() 공개 메소드

{@inheritDoc} A jackalope node needs to notify the parent node about this if it is cached, in addition to \PHPCR\ItemInterface::remove()
public remove ( )

removeMixin() 공개 메소드

{@inheritDoc}
public removeMixin ( $mixinName )

removeShare() 공개 메소드

{@inheritDoc}
public removeShare ( )

removeSharedSet() 공개 메소드

{@inheritDoc}
public removeSharedSet ( )

rename() 공개 메소드

{@inheritDoc}
public rename ( $newName )

rollbackTransaction() 공개 메소드

Additionally, notifies all properties of this node. Child nodes are not notified, it is the job of the ObjectManager to know which nodes are cached and notify them.
public rollbackTransaction ( )

setChildrenDirty() 공개 메소드

Mark all cached children as dirty.
public setChildrenDirty ( )

setDeleted() 공개 메소드

They will be automatically deleted by the backend, but the user might still have a reference to one of the property objects.
public setDeleted ( )

setDirty() 공개 메소드

Overwrite to set the properties dirty as well.
public setDirty ( $keepChanges = false, $targetState = false )

setMixins() 공개 메소드

{@inheritDoc}
public setMixins ( array $mixinNames )
$mixinNames array

setPath() 공개 메소드

In addition to calling parent method, tell all properties
public setPath ( $path, $move = false )

setPrimaryType() 공개 메소드

{@inheritDoc} Jackalope only validates type conflicts on save.
public setPrimaryType ( $nodeTypeName )

setProperty() 공개 메소드

{@inheritDoc}
public setProperty ( $name, $value, $type = PropertyType::UNDEFINED, boolean $validate = true )
$validate boolean does the NodeType control throw an exception if the property can't be set? To use in case of UUID import

unsetChildNode() 공개 메소드

Removes the reference in the internal node storage
public unsetChildNode ( string $name, boolean $check )
$name string the name of the child node to unset
$check boolean whether a state check should be done - set to false during internal update operations

unsetProperty() 공개 메소드

Removes the reference in the internal node storage
public unsetProperty ( string $name )
$name string the name of the property to unset.

update() 공개 메소드

{@inheritDoc}
public update ( $srcWorkspace )

프로퍼티 상세

$definition 보호되어 있는 프로퍼티

Cached instance of the node definition that defines this node
또한 보기: Node::getDefinition()
protected NodeDefinitionInterface,PHPCR\NodeType $definition
리턴 PHPCR\NodeType\NodeDefinitionInterface

$deletedProperties 보호되어 있는 프로퍼티

this is needed in order to track deletions in case of refresh keys are the property names, values the properties (in state deleted)
protected $deletedProperties

$index 보호되어 있는 프로퍼티

TODO: fully implement same-name siblings
protected int $index
리턴 integer

$nodes 보호되어 있는 프로퍼티

ordered list of the child node names
protected array $nodes
리턴 array

$originalNodesOrder 보호되어 있는 프로퍼티

used to calculate reordering operations if orderBefore() was used
protected array $originalNodesOrder
리턴 array

$primaryType 보호되어 있는 프로퍼티

The primary type name of this node
protected string $primaryType
리턴 string

$properties 보호되어 있는 프로퍼티

all properties are instantiated in the constructor OPTIMIZE: lazy instantiate property objects, just have local array of values
protected Property[],jackalope $properties
리턴 Property[]