PHP Class Neos\ContentRepository\Domain\Model\Node

Inheritance: implements Neos\ContentRepository\Domain\Model\NodeInterface, implements Neos\Cache\CacheAwareInterface
Show file Open project: neos/neos-development-collection Class Usage Examples

Protected Properties

Property Type Description
$context Neos\ContentRepository\Domain\Service\Context
$contextFactory Neos\ContentRepository\Domain\Service\ContextFactoryInterface
$nodeData NodeData The NodeData entity this version is for.
$nodeDataIsMatchingContext boolean Defines if the NodeData represented by this Node is already in the same context or if it is currently just "shining through".
$nodeDataRepository Neos\ContentRepository\Domain\Repository\NodeDataRepository
$nodeFactory Neos\ContentRepository\Domain\Factory\NodeFactory
$nodeService Neos\ContentRepository\Domain\Service\NodeServiceInterface
$propertyMapper Neos\Flow\Property\PropertyMapper

Public Methods

Method Description
__construct ( NodeData $nodeData, Context $context )
__toString ( ) : string For debugging purposes, the node can be converted to a string.
copyAfter ( Neos\ContentRepository\Domain\Model\NodeInterface $referenceNode, string $nodeName ) : Neos\ContentRepository\Domain\Model\NodeInterface Copies this node after the given node
copyBefore ( Neos\ContentRepository\Domain\Model\NodeInterface $referenceNode, string $nodeName ) : Neos\ContentRepository\Domain\Model\NodeInterface Copies this node before the given node
copyInto ( Neos\ContentRepository\Domain\Model\NodeInterface $referenceNode, string $nodeName ) : Neos\ContentRepository\Domain\Model\NodeInterface Copies this node into the given node
createNode ( string $name, NodeType $nodeType = null, string $identifier = null ) : Neos\ContentRepository\Domain\Model\NodeInterface Creates, adds and returns a child node of this node. Also sets default properties and creates default subnodes.
createNodeFromTemplate ( NodeTemplate $nodeTemplate, string $nodeName = null ) : Neos\ContentRepository\Domain\Model\NodeInterface Creates and persists a node from the given $nodeTemplate as child node
createSingleNode ( string $name, NodeType $nodeType = null, string $identifier = null ) : Node Creates, adds and returns a child node of this node, without setting default properties or creating subnodes. Only used internally.
createVariantForContext ( Context $context ) : Neos\ContentRepository\Domain\Model\NodeInterface Given a context a new node is returned that is like this node, but lives in the new context.
dimensionsAreMatchingTargetDimensionValues ( ) : boolean Internal method
getAccessRoles ( ) : array Returns the names of defined access roles
getCacheEntryIdentifier ( ) : string Returns a string which distinctly identifies this object and thus can be used as an identifier for cache entries related to this object.
getChildNodes ( string $nodeTypeFilter = null, integer $limit = null, integer $offset = null ) : array<\Neos\ContentRepository\Domain\Model\NodeInterface> Returns all direct child nodes of this node.
getContentObject ( ) : object Returns the content object of this node (if any).
getContext ( ) : Context Returns the context this node operates in.
getContextPath ( ) : string Returns the absolute path of this node with additional context information (such as the workspace name).
getCreationDateTime ( ) : DateTimeInterface
getDepth ( ) : integer Returns the level at which this node is located.
getDimensions ( ) : array Return the assigned content dimensions of the node.
getFullLabel ( ) : string Returns a full length plain text description of this node
getHiddenAfterDateTime ( ) : DateTime Returns the date and time after which this node will be automatically hidden.
getHiddenBeforeDateTime ( ) : DateTime Returns the date and time before which this node will be automatically hidden.
getIdentifier ( ) : string Returns the identifier of this node
getIndex ( ) : integer Returns the index of this node which determines the order among siblings with the same parent node.
getLabel ( ) : string Returns the node label as generated by the configured node label generator
getLastModificationDateTime ( ) : DateTimeInterface
getLastPublicationDateTime ( ) : DateTime
getName ( ) : string Returns the name of this node
getNode ( string $path ) : Neos\ContentRepository\Domain\Model\NodeInterface Returns a node specified by the given relative path.
getNodeData ( ) : NodeData
getNodeType ( ) : NodeType Returns the node type of this node.
getNumberOfChildNodes ( string $nodeTypeFilter = null ) : integer Returns the number of child nodes a similar getChildNodes() call would return.
getOtherNodeVariants ( )
getParent ( ) : Neos\ContentRepository\Domain\Model\NodeInterface Returns the parent node of this node
getParentPath ( ) : string Returns the parent node path
getPath ( ) : string Returns the path of this node
getPrimaryChildNode ( ) : Node Returns the primary child node of this node.
getProperties ( boolean $returnNodesAsIdentifiers = false ) : array Returns all properties of this node.
getProperty ( string $propertyName, boolean $returnNodesAsIdentifiers = false ) : mixed Returns the specified property.
getPropertyNames ( ) : array Returns the names of all properties of this node.
getWorkspace ( ) : Workspace Returns the workspace this node is contained in
hasAccessRestrictions ( ) : boolean Tells if a node, in general, has access restrictions, independent of the current security context.
hasChildNodes ( string $nodeTypeFilter = null ) : boolean Checks if this node has any child nodes.
hasProperty ( string $propertyName ) : boolean If this node has a property with the given name.
isAccessible ( ) : boolean Tells if this node may be accessed according to the current security context.
isAutoCreated ( ) : boolean Determine if this node is configured as auto-created childNode of the parent node. If that is the case, it should not be deleted.
isHidden ( ) : boolean Returns the current state of the hidden flag
isHiddenInIndex ( ) : boolean If this node should be hidden in indexes
isNodeTypeAllowedAsChildNode ( NodeType $nodeType ) : boolean Checks if the given $nodeType would be allowed as a child node of this node according to the configured constraints.
isRemoved ( ) : boolean If this node is a removed node.
isVisible ( ) : boolean Tells if this node is "visible".
moveAfter ( Neos\ContentRepository\Domain\Model\NodeInterface $referenceNode, string $newName = null ) Moves this node after the given node
moveBefore ( Neos\ContentRepository\Domain\Model\NodeInterface $referenceNode, string $newName = null ) Moves this node before the given node
moveInto ( Neos\ContentRepository\Domain\Model\NodeInterface $referenceNode, string $newName = null ) Moves this node into the given node
remove ( ) : void Removes this node and all its child nodes. This is an alias for setRemoved(TRUE)
removeProperty ( string $propertyName ) : void Removes the specified property.
setAccessRoles ( array $accessRoles ) : void Sets the roles which are required to access this node
setContentObject ( object $contentObject ) : void Sets a content object for this node.
setHidden ( boolean $hidden ) : void Sets the "hidden" flag for this node.
setHiddenAfterDateTime ( DateTime $dateTime = null ) : void Sets the date and time when this node should be automatically hidden
setHiddenBeforeDateTime ( DateTime $dateTime = null ) : void Sets the date and time when this node becomes potentially visible.
setHiddenInIndex ( boolean $hidden ) : void Sets if this node should be hidden in indexes, such as a site navigation.
setIndex ( integer $index ) : void Sets the index of this node
setLastPublicationDateTime ( DateTimeInterface $lastModificationDateTime ) : void
setName ( string $newName ) : void Set the name of the node to $newName, keeping its position as it is.
setNodeData ( NodeData $nodeData ) : void Set the associated NodeData in regards to the Context.
setNodeDataIsMatchingContext ( boolean $status ) : void Set the status of the associated NodeData in regards to the Context.
setNodeType ( NodeType $nodeType ) : void Sets the node type of this node.
setProperty ( string $propertyName, mixed $value ) : mixed Sets the specified property.
setRemoved ( boolean $removed ) : void Enables using the remove method when only setters are available
setWorkspace ( Workspace $workspace ) : void Sets the workspace of this node.
similarize ( Neos\ContentRepository\Domain\Model\NodeInterface $sourceNode, boolean $isCopy = false ) : void For internal use in createRecursiveCopy.
unsetContentObject ( ) : void Unsets the content object of this node.

Protected Methods

Method Description
copyIntoInternal ( Neos\ContentRepository\Domain\Model\NodeInterface $referenceNode, $nodeName, boolean $detachedCopy ) : Neos\ContentRepository\Domain\Model\NodeInterface Internal method to do the actual copying.
createNodeForVariant ( NodeData $nodeData ) : Node Create a node for the given NodeData, given that it is a variant of the current node
createRecursiveCopy ( Neos\ContentRepository\Domain\Model\NodeInterface $referenceNode, string $nodeName, boolean $detachedCopy ) : Neos\ContentRepository\Domain\Model\NodeInterface Create a recursive copy of this node below $referenceNode with $nodeName.
emitAfterNodeCopy ( Neos\ContentRepository\Domain\Model\NodeInterface $copiedNode, Neos\ContentRepository\Domain\Model\NodeInterface $targetParentNode ) : void
emitAfterNodeCreate ( Neos\ContentRepository\Domain\Model\NodeInterface $node ) : void Signals that a node was created.
emitAfterNodeMove ( Neos\ContentRepository\Domain\Model\NodeInterface $movedNode, Neos\ContentRepository\Domain\Model\NodeInterface $referenceNode, integer $movePosition ) : void
emitBeforeNodeCopy ( Neos\ContentRepository\Domain\Model\NodeInterface $sourceNode, Neos\ContentRepository\Domain\Model\NodeInterface $targetParentNode ) : void
emitBeforeNodeCreate ( Neos\ContentRepository\Domain\Model\NodeInterface $node, string $name, string $nodeType, string $identifier ) : void Signals that a node will be created.
emitBeforeNodeMove ( Neos\ContentRepository\Domain\Model\NodeInterface $movedNode, Neos\ContentRepository\Domain\Model\NodeInterface $referenceNode, integer $movePosition ) : void
emitBeforeNodePropertyChange ( Neos\ContentRepository\Domain\Model\NodeInterface $node, string $propertyName, mixed $oldValue, mixed $newValue ) : void Signals that the property of a node will be changed.
emitNodeAdded ( Neos\ContentRepository\Domain\Model\NodeInterface $node ) : void Signals that a node was added.
emitNodePathChanged ( Neos\ContentRepository\Domain\Model\NodeInterface $node, string $oldPath, string $newPath, boolean $recursion ) Signals that the node path has been changed.
emitNodePropertyChanged ( Neos\ContentRepository\Domain\Model\NodeInterface $node, string $propertyName, mixed $oldValue, mixed $newValue ) : void Signals that the property of a node was changed.
emitNodeRemoved ( Neos\ContentRepository\Domain\Model\NodeInterface $node ) : void Signals that a node was removed.
emitNodeUpdated ( Neos\ContentRepository\Domain\Model\NodeInterface $node ) : void Signals that a node was updated.
isNodeDataMatchingContext ( ) : boolean The NodeData matches the context if the workspace matches exactly.
isNodePathAvailable ( string $path ) : boolean Checks if the given node path is available for this node, so either no node with this path exists or an existing node has the same identifier.
materializeNodeData ( ) : void Materializes the original node data (of a different workspace) into the current workspace.
moveNodeData ( NodeData $nodeData, string $originalPath, string $destinationPath, boolean $recursiveCall ) : array | null Moves a NodeData object that is either a variant or child node to the given destination path.
moveNodeToDestinationPath ( Neos\ContentRepository\Domain\Model\NodeInterface $node, string $destinationPath ) : void Moves the given node to the destination path by modifying the underlaying NodeData object.
moveVariantOrChild ( string $aggregateOriginalPath, string $aggregateDestinationPath, Neos\ContentRepository\Domain\Model\NodeInterface $nodeToMove = null ) : array Moves the given variant or child node to the destination defined by the given path which is the new path for the originally moved (parent|variant) node
resolvePropertyReferences ( array $value = [] ) : array Maps the property value (an array of node identifiers) to the Node objects if needed.
setPath ( string $path, boolean $checkForExistence = true ) : void Sets the absolute path of this node.
setPathInternal ( string $destinationPath, boolean $recursiveCall ) : array Moves a node and sub nodes to the new path.
setPathInternalForAggregate ( string $destinationPath, boolean $recursiveCall ) : array Moves a node and sub nodes to the new path given with special logic for aggregate node types.
willChildNodeBeAutoCreated ( string $name ) : boolean Checks if the given Node $name is configured as auto-created childNode in the NodeType configuration.

Method Details

__construct() public method

public __construct ( NodeData $nodeData, Context $context )
$nodeData NodeData
$context Neos\ContentRepository\Domain\Service\Context

__toString() public method

For debugging purposes, the node can be converted to a string.
public __toString ( ) : string
return string

copyAfter() public method

Copies this node after the given node
public copyAfter ( Neos\ContentRepository\Domain\Model\NodeInterface $referenceNode, string $nodeName ) : Neos\ContentRepository\Domain\Model\NodeInterface
$referenceNode Neos\ContentRepository\Domain\Model\NodeInterface
$nodeName string
return Neos\ContentRepository\Domain\Model\NodeInterface

copyBefore() public method

Copies this node before the given node
public copyBefore ( Neos\ContentRepository\Domain\Model\NodeInterface $referenceNode, string $nodeName ) : Neos\ContentRepository\Domain\Model\NodeInterface
$referenceNode Neos\ContentRepository\Domain\Model\NodeInterface
$nodeName string
return Neos\ContentRepository\Domain\Model\NodeInterface

copyInto() public method

Copies this node into the given node
public copyInto ( Neos\ContentRepository\Domain\Model\NodeInterface $referenceNode, string $nodeName ) : Neos\ContentRepository\Domain\Model\NodeInterface
$referenceNode Neos\ContentRepository\Domain\Model\NodeInterface
$nodeName string
return Neos\ContentRepository\Domain\Model\NodeInterface

copyIntoInternal() protected method

For behavior of the $detachedCopy parameter, see method Node::createRecursiveCopy().
protected copyIntoInternal ( Neos\ContentRepository\Domain\Model\NodeInterface $referenceNode, $nodeName, boolean $detachedCopy ) : Neos\ContentRepository\Domain\Model\NodeInterface
$referenceNode Neos\ContentRepository\Domain\Model\NodeInterface
$nodeName
$detachedCopy boolean
return Neos\ContentRepository\Domain\Model\NodeInterface

createNode() public method

Creates, adds and returns a child node of this node. Also sets default properties and creates default subnodes.
public createNode ( string $name, NodeType $nodeType = null, string $identifier = null ) : Neos\ContentRepository\Domain\Model\NodeInterface
$name string Name of the new node
$nodeType NodeType Node type of the new node (optional)
$identifier string The identifier of the node, unique within the workspace, optional(!)
return Neos\ContentRepository\Domain\Model\NodeInterface

createNodeForVariant() protected method

Create a node for the given NodeData, given that it is a variant of the current node
protected createNodeForVariant ( NodeData $nodeData ) : Node
$nodeData NodeData
return Node

createNodeFromTemplate() public method

Creates and persists a node from the given $nodeTemplate as child node
public createNodeFromTemplate ( NodeTemplate $nodeTemplate, string $nodeName = null ) : Neos\ContentRepository\Domain\Model\NodeInterface
$nodeTemplate NodeTemplate
$nodeName string name of the new node. If not specified the name of the nodeTemplate will be used.
return Neos\ContentRepository\Domain\Model\NodeInterface the freshly generated node

createRecursiveCopy() protected method

$detachedCopy only has an influence if we are copying from one dimension to the other, possibly creating a new node variant: - If $detachedCopy is TRUE, the whole (recursive) copy is done without connecting original and copied node, so NOT CREATING a new node variant. - If $detachedCopy is FALSE, and the node does not yet have a variant in the target dimension, we are CREATING a new node variant. As a caller of this method, $detachedCopy should be TRUE if $this->getNodeType()->isAggregate() is TRUE, and FALSE otherwise.
protected createRecursiveCopy ( Neos\ContentRepository\Domain\Model\NodeInterface $referenceNode, string $nodeName, boolean $detachedCopy ) : Neos\ContentRepository\Domain\Model\NodeInterface
$referenceNode Neos\ContentRepository\Domain\Model\NodeInterface
$nodeName string
$detachedCopy boolean
return Neos\ContentRepository\Domain\Model\NodeInterface

createSingleNode() public method

For internal use only! TODO: New SiteImportService uses createNode() and DQL. When we drop the LegagcySiteImportService we can change this to protected.
public createSingleNode ( string $name, NodeType $nodeType = null, string $identifier = null ) : Node
$name string Name of the new node
$nodeType NodeType Node type of the new node (optional)
$identifier string The identifier of the node, unique within the workspace, optional(!)
return Node

createVariantForContext() public method

Given a context a new node is returned that is like this node, but lives in the new context.
public createVariantForContext ( Context $context ) : Neos\ContentRepository\Domain\Model\NodeInterface
$context Neos\ContentRepository\Domain\Service\Context
return Neos\ContentRepository\Domain\Model\NodeInterface

dimensionsAreMatchingTargetDimensionValues() public method

The dimension value of this node has to match the current target dimension value (must be higher in priority or equal)

emitAfterNodeCopy() protected method

protected emitAfterNodeCopy ( Neos\ContentRepository\Domain\Model\NodeInterface $copiedNode, Neos\ContentRepository\Domain\Model\NodeInterface $targetParentNode ) : void
$copiedNode Neos\ContentRepository\Domain\Model\NodeInterface
$targetParentNode Neos\ContentRepository\Domain\Model\NodeInterface
return void

emitAfterNodeCreate() protected method

Signals that a node was created.
protected emitAfterNodeCreate ( Neos\ContentRepository\Domain\Model\NodeInterface $node ) : void
$node Neos\ContentRepository\Domain\Model\NodeInterface
return void

emitAfterNodeMove() protected method

protected emitAfterNodeMove ( Neos\ContentRepository\Domain\Model\NodeInterface $movedNode, Neos\ContentRepository\Domain\Model\NodeInterface $referenceNode, integer $movePosition ) : void
$movedNode Neos\ContentRepository\Domain\Model\NodeInterface
$referenceNode Neos\ContentRepository\Domain\Model\NodeInterface
$movePosition integer
return void

emitBeforeNodeCopy() protected method

protected emitBeforeNodeCopy ( Neos\ContentRepository\Domain\Model\NodeInterface $sourceNode, Neos\ContentRepository\Domain\Model\NodeInterface $targetParentNode ) : void
$sourceNode Neos\ContentRepository\Domain\Model\NodeInterface
$targetParentNode Neos\ContentRepository\Domain\Model\NodeInterface
return void

emitBeforeNodeCreate() protected method

Signals that a node will be created.
protected emitBeforeNodeCreate ( Neos\ContentRepository\Domain\Model\NodeInterface $node, string $name, string $nodeType, string $identifier ) : void
$node Neos\ContentRepository\Domain\Model\NodeInterface
$name string
$nodeType string
$identifier string
return void

emitBeforeNodeMove() protected method

protected emitBeforeNodeMove ( Neos\ContentRepository\Domain\Model\NodeInterface $movedNode, Neos\ContentRepository\Domain\Model\NodeInterface $referenceNode, integer $movePosition ) : void
$movedNode Neos\ContentRepository\Domain\Model\NodeInterface
$referenceNode Neos\ContentRepository\Domain\Model\NodeInterface
$movePosition integer
return void

emitBeforeNodePropertyChange() protected method

Signals that the property of a node will be changed.
protected emitBeforeNodePropertyChange ( Neos\ContentRepository\Domain\Model\NodeInterface $node, string $propertyName, mixed $oldValue, mixed $newValue ) : void
$node Neos\ContentRepository\Domain\Model\NodeInterface
$propertyName string name of the property that has been changed/added
$oldValue mixed the property value before it was changed or NULL if the property is new
$newValue mixed the new property value
return void

emitNodeAdded() protected method

Signals that a node was added.
protected emitNodeAdded ( Neos\ContentRepository\Domain\Model\NodeInterface $node ) : void
$node Neos\ContentRepository\Domain\Model\NodeInterface
return void

emitNodePathChanged() protected method

Signals that the node path has been changed.
protected emitNodePathChanged ( Neos\ContentRepository\Domain\Model\NodeInterface $node, string $oldPath, string $newPath, boolean $recursion )
$node Neos\ContentRepository\Domain\Model\NodeInterface
$oldPath string
$newPath string
$recursion boolean TRUE if the node path change was caused because a parent node path was changed

emitNodePropertyChanged() protected method

Signals that the property of a node was changed.
protected emitNodePropertyChanged ( Neos\ContentRepository\Domain\Model\NodeInterface $node, string $propertyName, mixed $oldValue, mixed $newValue ) : void
$node Neos\ContentRepository\Domain\Model\NodeInterface
$propertyName string name of the property that has been changed/added
$oldValue mixed the property value before it was changed or NULL if the property is new
$newValue mixed the new property value
return void

emitNodeRemoved() protected method

Signals that a node was removed.
protected emitNodeRemoved ( Neos\ContentRepository\Domain\Model\NodeInterface $node ) : void
$node Neos\ContentRepository\Domain\Model\NodeInterface
return void

emitNodeUpdated() protected method

Signals that a node was updated.
protected emitNodeUpdated ( Neos\ContentRepository\Domain\Model\NodeInterface $node ) : void
$node Neos\ContentRepository\Domain\Model\NodeInterface
return void

getAccessRoles() public method

Returns the names of defined access roles
public getAccessRoles ( ) : array
return array

getCacheEntryIdentifier() public method

Returns a string which distinctly identifies this object and thus can be used as an identifier for cache entries related to this object.
public getCacheEntryIdentifier ( ) : string
return string

getChildNodes() public method

If a node type is specified, only nodes of that type are returned.
public getChildNodes ( string $nodeTypeFilter = null, integer $limit = null, integer $offset = null ) : array<\Neos\ContentRepository\Domain\Model\NodeInterface>
$nodeTypeFilter string If specified, only nodes with that node type are considered
$limit integer An optional limit for the number of nodes to find. Added or removed nodes can still change the number nodes!
$offset integer An optional offset for the query
return array<\Neos\ContentRepository\Domain\Model\NodeInterface>

getContentObject() public method

Returns the content object of this node (if any).
public getContentObject ( ) : object
return object

getContext() public method

Returns the context this node operates in.
public getContext ( ) : Context
return Neos\ContentRepository\Domain\Service\Context

getContextPath() public method

Example: /sites/mysitecom/homepage/about@user-admin
public getContextPath ( ) : string
return string Node path with context information

getCreationDateTime() public method

public getCreationDateTime ( ) : DateTimeInterface
return DateTimeInterface

getDepth() public method

Counting starts with 0 for "/", 1 for "/foo", 2 for "/foo/bar" etc.
public getDepth ( ) : integer
return integer

getDimensions() public method

Return the assigned content dimensions of the node.
public getDimensions ( ) : array
return array

getFullLabel() public method

Returns a full length plain text description of this node
Deprecation: since 1.2
public getFullLabel ( ) : string
return string

getHiddenAfterDateTime() public method

Returns the date and time after which this node will be automatically hidden.
public getHiddenAfterDateTime ( ) : DateTime
return DateTime Date after which this node will be hidden

getHiddenBeforeDateTime() public method

Returns the date and time before which this node will be automatically hidden.
public getHiddenBeforeDateTime ( ) : DateTime
return DateTime Date before this node will be hidden

getIdentifier() public method

Returns the identifier of this node
public getIdentifier ( ) : string
return string the node's UUID (unique within the workspace)

getIndex() public method

Returns the index of this node which determines the order among siblings with the same parent node.
public getIndex ( ) : integer
return integer

getLabel() public method

Returns the node label as generated by the configured node label generator
public getLabel ( ) : string
return string

getLastModificationDateTime() public method

public getLastModificationDateTime ( ) : DateTimeInterface
return DateTimeInterface

getLastPublicationDateTime() public method

public getLastPublicationDateTime ( ) : DateTime
return DateTime

getName() public method

Returns the name of this node
public getName ( ) : string
return string

getNode() public method

Returns a node specified by the given relative path.
public getNode ( string $path ) : Neos\ContentRepository\Domain\Model\NodeInterface
$path string Path specifying the node, relative to this node
return Neos\ContentRepository\Domain\Model\NodeInterface The specified node or NULL if no such node exists

getNodeData() public method

public getNodeData ( ) : NodeData
return NodeData

getNodeType() public method

Returns the node type of this node.
public getNodeType ( ) : NodeType
return NodeType

getNumberOfChildNodes() public method

Returns the number of child nodes a similar getChildNodes() call would return.
public getNumberOfChildNodes ( string $nodeTypeFilter = null ) : integer
$nodeTypeFilter string If specified, only nodes with that node type are considered
return integer The number of child nodes

getOtherNodeVariants() public method

getParent() public method

Returns the parent node of this node
public getParent ( ) : Neos\ContentRepository\Domain\Model\NodeInterface
return Neos\ContentRepository\Domain\Model\NodeInterface The parent node or NULL if this is the root node

getParentPath() public method

Returns the parent node path
public getParentPath ( ) : string
return string Absolute node path of the parent node

getPath() public method

Returns the path of this node
public getPath ( ) : string
return string

getPrimaryChildNode() public method

Which node acts as a primary child node will in the future depend on the node type. For now it is just the first child node.
public getPrimaryChildNode ( ) : Node
return Node The primary child node or NULL if no such node exists

getProperties() public method

If the node has a content object attached, the properties will be fetched there.
public getProperties ( boolean $returnNodesAsIdentifiers = false ) : array
$returnNodesAsIdentifiers boolean If enabled, references to nodes are returned as node identifiers instead of NodeData objects
return array Property values, indexed by their name

getProperty() public method

If the node has a content object attached, the property will be fetched there if it is gettable.
public getProperty ( string $propertyName, boolean $returnNodesAsIdentifiers = false ) : mixed
$propertyName string Name of the property
$returnNodesAsIdentifiers boolean If enabled, references to nodes are returned as node identifiers instead of NodeInterface instances
return mixed value of the property

getPropertyNames() public method

Returns the names of all properties of this node.
public getPropertyNames ( ) : array
return array Property names

getWorkspace() public method

Returns the workspace this node is contained in
public getWorkspace ( ) : Workspace
return Workspace

hasAccessRestrictions() public method

Tells if a node, in general, has access restrictions, independent of the current security context.
public hasAccessRestrictions ( ) : boolean
return boolean

hasChildNodes() public method

Checks if this node has any child nodes.
public hasChildNodes ( string $nodeTypeFilter = null ) : boolean
$nodeTypeFilter string If specified, only nodes with that node type are considered
return boolean TRUE if this node has child nodes, otherwise FALSE

hasProperty() public method

If the node has a content object attached, the property will be checked there.
public hasProperty ( string $propertyName ) : boolean
$propertyName string
return boolean

isAccessible() public method

Tells if this node may be accessed according to the current security context.
public isAccessible ( ) : boolean
return boolean

isAutoCreated() public method

Determine if this node is configured as auto-created childNode of the parent node. If that is the case, it should not be deleted.
public isAutoCreated ( ) : boolean
return boolean TRUE if this node is auto-created by the parent.

isHidden() public method

Returns the current state of the hidden flag
public isHidden ( ) : boolean
return boolean

isHiddenInIndex() public method

If this node should be hidden in indexes
public isHiddenInIndex ( ) : boolean
return boolean

isNodeDataMatchingContext() protected method

Needs to be adjusted for further context dimensions.
protected isNodeDataMatchingContext ( ) : boolean
return boolean

isNodePathAvailable() protected method

Checks if the given node path is available for this node, so either no node with this path exists or an existing node has the same identifier.
protected isNodePathAvailable ( string $path ) : boolean
$path string
return boolean

isNodeTypeAllowedAsChildNode() public method

Checks if the given $nodeType would be allowed as a child node of this node according to the configured constraints.
public isNodeTypeAllowedAsChildNode ( NodeType $nodeType ) : boolean
$nodeType NodeType
return boolean TRUE if the passed $nodeType is allowed as child node

isRemoved() public method

If this node is a removed node.
public isRemoved ( ) : boolean
return boolean

isVisible() public method

For this the "hidden" flag and the "hiddenBeforeDateTime" and "hiddenAfterDateTime" dates are taken into account.
public isVisible ( ) : boolean
return boolean

materializeNodeData() protected method

Materializes the original node data (of a different workspace) into the current workspace.
protected materializeNodeData ( ) : void
return void

moveAfter() public method

Moves this node after the given node
public moveAfter ( Neos\ContentRepository\Domain\Model\NodeInterface $referenceNode, string $newName = null )
$referenceNode Neos\ContentRepository\Domain\Model\NodeInterface
$newName string

moveBefore() public method

Moves this node before the given node
public moveBefore ( Neos\ContentRepository\Domain\Model\NodeInterface $referenceNode, string $newName = null )
$referenceNode Neos\ContentRepository\Domain\Model\NodeInterface
$newName string

moveInto() public method

Moves this node into the given node
public moveInto ( Neos\ContentRepository\Domain\Model\NodeInterface $referenceNode, string $newName = null )
$referenceNode Neos\ContentRepository\Domain\Model\NodeInterface
$newName string

moveNodeData() protected method

Moves a NodeData object that is either a variant or child node to the given destination path.
protected moveNodeData ( NodeData $nodeData, string $originalPath, string $destinationPath, boolean $recursiveCall ) : array | null
$nodeData NodeData
$originalPath string
$destinationPath string
$recursiveCall boolean
return array | null

moveNodeToDestinationPath() protected method

Moves the given node to the destination path by modifying the underlaying NodeData object.
protected moveNodeToDestinationPath ( Neos\ContentRepository\Domain\Model\NodeInterface $node, string $destinationPath ) : void
$node Neos\ContentRepository\Domain\Model\NodeInterface
$destinationPath string
return void

moveVariantOrChild() protected method

Moves the given variant or child node to the destination defined by the given path which is the new path for the originally moved (parent|variant) node
protected moveVariantOrChild ( string $aggregateOriginalPath, string $aggregateDestinationPath, Neos\ContentRepository\Domain\Model\NodeInterface $nodeToMove = null ) : array
$aggregateOriginalPath string
$aggregateDestinationPath string
$nodeToMove Neos\ContentRepository\Domain\Model\NodeInterface
return array NodeVariant and old and new path

remove() public method

Removes this node and all its child nodes. This is an alias for setRemoved(TRUE)
public remove ( ) : void
return void

removeProperty() public method

If the node has a content object attached, the property will not be removed on that object if it exists.
public removeProperty ( string $propertyName ) : void
$propertyName string Name of the property
return void

resolvePropertyReferences() protected method

Maps the property value (an array of node identifiers) to the Node objects if needed.
protected resolvePropertyReferences ( array $value = [] ) : array
$value array
return array

setAccessRoles() public method

Sets the roles which are required to access this node
public setAccessRoles ( array $accessRoles ) : void
$accessRoles array
return void

setContentObject() public method

Sets a content object for this node.
public setContentObject ( object $contentObject ) : void
$contentObject object The content object
return void

setHidden() public method

Sets the "hidden" flag for this node.
public setHidden ( boolean $hidden ) : void
$hidden boolean If TRUE, this Node will be hidden
return void

setHiddenAfterDateTime() public method

Sets the date and time when this node should be automatically hidden
public setHiddenAfterDateTime ( DateTime $dateTime = null ) : void
$dateTime DateTime Date after which this node should be hidden
return void

setHiddenBeforeDateTime() public method

Sets the date and time when this node becomes potentially visible.
public setHiddenBeforeDateTime ( DateTime $dateTime = null ) : void
$dateTime DateTime Date before this node should be hidden
return void

setHiddenInIndex() public method

Sets if this node should be hidden in indexes, such as a site navigation.
public setHiddenInIndex ( boolean $hidden ) : void
$hidden boolean TRUE if it should be hidden, otherwise FALSE
return void

setIndex() public method

NOTE: This method is meant for internal use and must only be used by other nodes.
public setIndex ( integer $index ) : void
$index integer The new index
return void

setLastPublicationDateTime() public method

public setLastPublicationDateTime ( DateTimeInterface $lastModificationDateTime ) : void
$lastModificationDateTime DateTimeInterface
return void

setName() public method

Set the name of the node to $newName, keeping its position as it is.
public setName ( string $newName ) : void
$newName string
return void

setNodeData() public method

NOTE: This is internal only and should not be used outside of the ContentRepository. TODO: As it is used in the Workspace this should become part of the interface in the next major release.
public setNodeData ( NodeData $nodeData ) : void
$nodeData NodeData
return void

setNodeDataIsMatchingContext() public method

NOTE: This is internal only and should not be used outside of the ContentRepository.
public setNodeDataIsMatchingContext ( boolean $status ) : void
$status boolean
return void

setNodeType() public method

Sets the node type of this node.
public setNodeType ( NodeType $nodeType ) : void
$nodeType NodeType
return void

setPath() protected method

This method is only for internal use by the content repository or node methods. Changing the path of a node manually may lead to unexpected behavior. To achieve a correct behavior when changing the path (moving the node) in a workspace, a shadow node data that will hide the node data in the base workspace will be created. Thus queries do not need to worry about moved nodes. Through a movedTo reference the shadow node data will be removed when publishing the moved node.
protected setPath ( string $path, boolean $checkForExistence = true ) : void
$path string
$checkForExistence boolean Checks for existence at target path, internally used for recursions and shadow nodes.
return void

setPathInternal() protected method

This process is different depending on the fact if the node is an aggregate type or not.
protected setPathInternal ( string $destinationPath, boolean $recursiveCall ) : array
$destinationPath string the new node path
$recursiveCall boolean is this a recursive call
return array NodeVariants and old and new paths

setPathInternalForAggregate() protected method

Moves a node and sub nodes to the new path given with special logic for aggregate node types.
protected setPathInternalForAggregate ( string $destinationPath, boolean $recursiveCall ) : array
$destinationPath string the new node path
$recursiveCall boolean is this a recursive call
return array of arrays with NodeVariant and old and new path and if this was a recursive call

setProperty() public method

If the node has a content object attached, the property will be set there if it is settable.
public setProperty ( string $propertyName, mixed $value ) : mixed
$propertyName string Name of the property
$value mixed Value of the property
return mixed

setRemoved() public method

Enables using the remove method when only setters are available
public setRemoved ( boolean $removed ) : void
$removed boolean If TRUE, this node and it's child nodes will be removed. If it is FALSE only this node will be restored.
return void

setWorkspace() public method

This method is only for internal use by the content repository. Changing the workspace of a node manually may lead to unexpected behavior.
public setWorkspace ( Workspace $workspace ) : void
$workspace Workspace
return void

similarize() public method

For internal use in createRecursiveCopy.
public similarize ( Neos\ContentRepository\Domain\Model\NodeInterface $sourceNode, boolean $isCopy = false ) : void
$sourceNode Neos\ContentRepository\Domain\Model\NodeInterface
$isCopy boolean
return void

unsetContentObject() public method

Unsets the content object of this node.
public unsetContentObject ( ) : void
return void

willChildNodeBeAutoCreated() protected method

Checks if the given Node $name is configured as auto-created childNode in the NodeType configuration.
protected willChildNodeBeAutoCreated ( string $name ) : boolean
$name string The node name to check.
return boolean TRUE if the given nodeName is configured as auto-created child node.

Property Details

$context protected property

protected Context,Neos\ContentRepository\Domain\Service $context
return Neos\ContentRepository\Domain\Service\Context

$contextFactory protected property

protected ContextFactoryInterface,Neos\ContentRepository\Domain\Service $contextFactory
return Neos\ContentRepository\Domain\Service\ContextFactoryInterface

$nodeData protected property

The NodeData entity this version is for.
protected NodeData,Neos\ContentRepository\Domain\Model $nodeData
return NodeData

$nodeDataIsMatchingContext protected property

Defines if the NodeData represented by this Node is already in the same context or if it is currently just "shining through".
protected bool $nodeDataIsMatchingContext
return boolean

$nodeDataRepository protected property

protected NodeDataRepository,Neos\ContentRepository\Domain\Repository $nodeDataRepository
return Neos\ContentRepository\Domain\Repository\NodeDataRepository

$nodeFactory protected property

protected NodeFactory,Neos\ContentRepository\Domain\Factory $nodeFactory
return Neos\ContentRepository\Domain\Factory\NodeFactory

$nodeService protected property

protected NodeServiceInterface,Neos\ContentRepository\Domain\Service $nodeService
return Neos\ContentRepository\Domain\Service\NodeServiceInterface

$propertyMapper protected property

protected PropertyMapper,Neos\Flow\Property $propertyMapper
return Neos\Flow\Property\PropertyMapper