interface NodeServiceInterface (View source)

Provides generic methods to manage and work with Nodes

Methods

void
setDefaultValues(NodeInterface $node)

Sets default node property values on the given node.

void
createChildNodes(NodeInterface $node)

Creates missing child nodes for the given node.

void
cleanUpProperties(NodeInterface $node)

Removes all properties not configured in the current Node Type.

void
cleanUpAutoCreatedChildNodes(NodeInterface $node, NodeType $oldNodeType)

Removes all auto created child nodes that existed in the previous nodeType.

bool
isNodeOfType(NodeInterface $node, NodeType $nodeType)

No description

bool
nodePathExistsInAnyContext(string $nodePath)

Checks if the given node path exists in any possible context already.

bool
nodePathAvailableForNode(string $nodePath, NodeInterface $node)

Checks if the given node path can be used for the given node.

string
normalizePath(string $path, string $referencePath = null)

Normalizes the given node path to a reference path and returns an absolute path.

string
generateUniqueNodeName(string $parentPath, string $idealNodeName = null)

Generates a possible node name, optionally based on a suggested "ideal" name.

Details

void setDefaultValues(NodeInterface $node)

Sets default node property values on the given node.

Parameters

NodeInterface $node

Return Value

void

void createChildNodes(NodeInterface $node)

Creates missing child nodes for the given node.

Parameters

NodeInterface $node

Return Value

void

void cleanUpProperties(NodeInterface $node)

Removes all properties not configured in the current Node Type.

Parameters

NodeInterface $node

Return Value

void

void cleanUpAutoCreatedChildNodes(NodeInterface $node, NodeType $oldNodeType)

Removes all auto created child nodes that existed in the previous nodeType.

Parameters

NodeInterface $node
NodeType $oldNodeType

Return Value

void

bool isNodeOfType(NodeInterface $node, NodeType $nodeType)

No description

Parameters

NodeInterface $node
NodeType $nodeType

Return Value

bool

bool nodePathExistsInAnyContext(string $nodePath)

Checks if the given node path exists in any possible context already.

Parameters

string $nodePath

Return Value

bool

bool nodePathAvailableForNode(string $nodePath, NodeInterface $node)

Checks if the given node path can be used for the given node.

Parameters

string $nodePath
NodeInterface $node

Return Value

bool

string normalizePath(string $path, string $referencePath = null)

Normalizes the given node path to a reference path and returns an absolute path.

Parameters

string $path

The non-normalized path

string $referencePath

a reference path in case the given path is relative.

Return Value

string

The normalized absolute path

Exceptions

InvalidArgumentException

string generateUniqueNodeName(string $parentPath, string $idealNodeName = null)

Generates a possible node name, optionally based on a suggested "ideal" name.

Parameters

string $parentPath
string $idealNodeName

Can be any string, doesn't need to be a valid node name.

Return Value

string

valid node name that is possible as child of the given $parentNode