interface TraversableNodeInterface implements NodeInterface (View source)

This is a NEW interface, introduced in Neos 4.3; and it will become the main interface with Neos 5.0 to the CR.

The main convenience Event-Sourced NodeInterface used for READING; containing data accessors and traversal methods.

All methods which are called get*() contain only information local to a node, so they can be accessed really quickly without any external lookup.

All methods which are called find*() may involve some database querying to fetch their information.

The TraversableNodeInterface is immutable, meaning its contents never change after creation. It is only used for reading.

Starting with version 5.0 (when backed by the Event Sourced CR), it is completely detached from storage; so it will not auto-update after a property changed in storage.

Methods

bool
isRoot()

Whether or not this node is the root of the graph, i.e. has no parent node

bool
isTethered()

Whether or not this node is tethered to its parent, fka auto created child node

getNodeType()

No description

NodeName|null
getNodeName()

No description

OriginDimensionSpacePoint
getOriginDimensionSpacePoint()

returns the DimensionSpacePoint the node is at home in. Usually needed to address a Node in a NodeAggregate in order to update it.

getProperties()

Returns all properties of this node. References are NOT part of this API; there you need to check getReference() and getReferences()

mixed
getProperty(string $propertyName)

Returns the specified property.

bool
hasProperty(string $propertyName)

If this node has a property with the given name. Does NOT check the NodeType; but checks for a non-NULL property value.

string
getLabel()

Returns the node label as generated by the configured node label generator

DimensionSpacePoint
getDimensionSpacePoint()

Returns the DimensionSpacePoint the node was requested in, i.e. one of the DimensionSpacePoints this node is visible in. If you need the DimensionSpacePoint where the node is actually at home, see getOriginDimensionSpacePoint()

findParentNode()

Retrieves and returns the parent node from the node's subgraph.

findNodePath()

Retrieves and returns the node's path to its root node.

findNamedChildNode(NodeName $nodeName)

Retrieves and returns a child node by name from the node's subgraph.

findChildNodes(NodeTypeConstraints $nodeTypeConstraints = null, int $limit = null, int $offset = null)

Retrieves and returns all direct child nodes of this node from its subgraph.

int
countChildNodes(NodeTypeConstraints $nodeTypeConstraints = null)

Returns the number of direct child nodes of this node from its subgraph.

findReferencedNodes()

Retrieves and returns all nodes referenced by this node from its subgraph.

findNamedReferencedNodes(PropertyName $edgeName)

Retrieves and returns nodes referenced by this node by name from its subgraph.

findReferencingNodes()

Retrieves and returns nodes referencing this node from its subgraph.

findNamedReferencingNodes(PropertyName $nodeName)

Retrieves and returns nodes referencing this node by name from its subgraph.

bool
equals(TraversableNodeInterface $other)

Compare whether two traversable nodes are equal

Details

bool isRoot()

Whether or not this node is the root of the graph, i.e. has no parent node

Return Value

bool

bool isTethered()

Whether or not this node is tethered to its parent, fka auto created child node

Return Value

bool

ContentStreamIdentifier getContentStreamIdentifier()

No description

NodeAggregateIdentifier getNodeAggregateIdentifier()

No description

NodeTypeName getNodeTypeName()

No description

Return Value

NodeTypeName

NodeType getNodeType()

No description

Return Value

NodeType

NodeName|null getNodeName()

No description

Return Value

NodeName|null

OriginDimensionSpacePoint getOriginDimensionSpacePoint()

returns the DimensionSpacePoint the node is at home in. Usually needed to address a Node in a NodeAggregate in order to update it.

Return Value

OriginDimensionSpacePoint

PropertyCollectionInterface getProperties()

Returns all properties of this node. References are NOT part of this API; there you need to check getReference() and getReferences()

Return Value

PropertyCollectionInterface

Property values, indexed by their name

mixed getProperty(string $propertyName)

Returns the specified property.

If the node has a content object attached, the property will be fetched there if it is gettable.

Parameters

string $propertyName

Name of the property

Return Value

mixed

value of the property

bool hasProperty(string $propertyName)

If this node has a property with the given name. Does NOT check the NodeType; but checks for a non-NULL property value.

Parameters

string $propertyName

Return Value

bool

string getLabel()

Returns the node label as generated by the configured node label generator

Return Value

string

DimensionSpacePoint getDimensionSpacePoint()

Returns the DimensionSpacePoint the node was requested in, i.e. one of the DimensionSpacePoints this node is visible in. If you need the DimensionSpacePoint where the node is actually at home, see getOriginDimensionSpacePoint()

Return Value

DimensionSpacePoint

TraversableNodeInterface findParentNode()

Retrieves and returns the parent node from the node's subgraph.

If no parent node is present, an NodeException is thrown.

Return Value

TraversableNodeInterface

the parent node, never null

Exceptions

NodeException

NodePath findNodePath()

Retrieves and returns the node's path to its root node.

Return Value

NodePath

TraversableNodeInterface findNamedChildNode(NodeName $nodeName)

Retrieves and returns a child node by name from the node's subgraph.

Parameters

NodeName $nodeName

The name

Return Value

TraversableNodeInterface

Exceptions

NodeException

TraversableNodes findChildNodes(NodeTypeConstraints $nodeTypeConstraints = null, int $limit = null, int $offset = null)

Retrieves and returns all direct child nodes of this node from its subgraph.

If node type constraints are specified, only nodes of that type are returned.

Parameters

NodeTypeConstraints $nodeTypeConstraints

If specified, only nodes with that node type are considered

int $limit

An optional limit for the number of nodes to find. Added or removed nodes can still change the number nodes!

int $offset

An optional offset for the query

Return Value

TraversableNodes

Traversable nodes that matched the given constraints

int countChildNodes(NodeTypeConstraints $nodeTypeConstraints = null)

Returns the number of direct child nodes of this node from its subgraph.

Parameters

NodeTypeConstraints $nodeTypeConstraints

If specified, only nodes with that node type are considered

Return Value

int

TraversableNodes findReferencedNodes()

Retrieves and returns all nodes referenced by this node from its subgraph.

Return Value

TraversableNodes

TraversableNodes findNamedReferencedNodes(PropertyName $edgeName)

Retrieves and returns nodes referenced by this node by name from its subgraph.

Parameters

PropertyName $edgeName

Return Value

TraversableNodes

TraversableNodes findReferencingNodes()

Retrieves and returns nodes referencing this node from its subgraph.

Return Value

TraversableNodes

TraversableNodes findNamedReferencingNodes(PropertyName $nodeName)

Retrieves and returns nodes referencing this node by name from its subgraph.

Parameters

PropertyName $nodeName

Return Value

TraversableNodes

bool equals(TraversableNodeInterface $other)

Compare whether two traversable nodes are equal

Parameters

TraversableNodeInterface $other

Return Value

bool