PHP Interface Neos\ContentRepository\Domain\Model\NodeInterface

Mostra file Open project: neos/neos-development-collection Interface Usage Examples

Public Methods

Method Description
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 to below the given node. The new node will be added behind any existing sub nodes of the given node.
createNode ( string $name, NodeType $nodeType = null, string $identifier = null ) : Node 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.
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.
getAccessRoles ( ) : array Returns the names of defined access roles
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 Return the context of the node
getContextPath ( ) : string Returns the absolute path of this node with additional context information (such as the workspace name).
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 label 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 a full length plain text label of this node
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 Return the NodeData representation of the node.
getNodeType ( ) : NodeType Returns the node type of this node.
getOtherNodeVariants ( ) : array Get other variants of this node (with different dimension values)
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 ( ) : Neos\ContentRepository\Domain\Model\NodeInterface Returns the primary child node of this node.
getProperties ( ) : array Returns all properties of this node.
getProperty ( string $propertyName ) : 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 ) : void Moves this node after the given node
moveBefore ( Neos\ContentRepository\Domain\Model\NodeInterface $referenceNode ) : void Moves this node before the given node
moveInto ( Neos\ContentRepository\Domain\Model\NodeInterface $referenceNode ) : void 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
setName ( string $newName ) : void Set the name of the node to $newName, keeping it's position as it is
setNodeType ( NodeType $nodeType ) : void Sets the node type of this node.
setProperty ( string $propertyName, mixed $value ) : void Sets the specified property.
setRemoved ( boolean $removed ) : void Removes this node and all its child nodes or sets ONLY this node to not being removed.
setWorkspace ( Workspace $workspace ) : void Sets the workspace of this node.
unsetContentObject ( ) : void Unsets the content object of this node.

Method Details

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 to below the given node. The new node will be added behind any existing sub nodes of 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

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 ) : 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

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

createSingleNode() public method

For internal use only!
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

getAccessRoles() public method

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

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 The content object or NULL if none was set

getContext() public method

Return the context of the node
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

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 An array of dimensions to array of dimension values

getFullLabel() public method

Returns a full length plain text label 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

This UUID is not the same as the technical persistence identifier used by Flow's persistence framework. It is an additional identifier which is unique within the same workspace and is used for tracking the same node in across workspaces. It is okay and recommended to use this identifier for synchronisation purposes as it does not change even if all of the nodes content or its path changes.
public getIdentifier ( ) : string
return string the node's UUID

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 a full length plain text label of this node
public getLabel ( ) : string
return string

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

Return the NodeData representation of the node.
public getNodeData ( ) : NodeData
return NodeData

getNodeType() public method

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

getOtherNodeVariants() public method

A variant of a node can have different dimension values and path (for non-aggregate nodes). The resulting node instances might belong to a different context.
public getOtherNodeVariants ( ) : array
return array

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

Example: /sites/mysitecom/homepage/about
public getPath ( ) : string
return string The absolute node path

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 ( ) : Neos\ContentRepository\Domain\Model\NodeInterface
return Neos\ContentRepository\Domain\Model\NodeInterface 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 ( ) : array
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 ) : mixed
$propertyName string Name of the property
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 Name of the property to test for
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

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

moveAfter() public method

Moves this node after the given node
public moveAfter ( Neos\ContentRepository\Domain\Model\NodeInterface $referenceNode ) : void
$referenceNode Neos\ContentRepository\Domain\Model\NodeInterface
return void

moveBefore() public method

Moves this node before the given node
public moveBefore ( Neos\ContentRepository\Domain\Model\NodeInterface $referenceNode ) : void
$referenceNode Neos\ContentRepository\Domain\Model\NodeInterface
return void

moveInto() public method

Moves this node into the given node
public moveInto ( Neos\ContentRepository\Domain\Model\NodeInterface $referenceNode ) : void
$referenceNode Neos\ContentRepository\Domain\Model\NodeInterface
return void

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

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

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

setName() public method

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

setNodeType() public method

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

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 ) : void
$propertyName string Name of the property
$value mixed Value of the property
return void

setRemoved() public method

Removes this node and all its child nodes or sets ONLY this node to not being removed.
public setRemoved ( boolean $removed ) : void
$removed boolean If TRUE, this node and it's child nodes will be removed or set to be not removed.
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

unsetContentObject() public method

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