class NodeView extends JsonView (View source)

An View specialized on single or multiple Nodes in a tree structure

NOTE: This class only exists for backwards compatibility with not-yet refactored service end points and service controllers.

Constants

STYLE_LIST

STYLE_TREE

Properties

protected int $outputStyle
protected LoggerInterface $systemLogger
protected PrivilegeManagerInterface $privilegeManager

Methods

void
assignNode(NodeInterface $node, array $propertyNames = ['name', 'path', 'identifier', 'properties', 'nodeType'])

Assigns a node to the NodeView.

void
assignNodes(array $nodes)

No description

void
assignChildNodes(NodeInterface $node, string $nodeTypeFilter, int $outputStyle = self::STYLE_LIST, int $depth = 0, NodeInterface $untilNode = null)

Prepares this view to render a list or tree of child nodes of the given node.

void
assignNodeAndChildNodes(NodeInterface $node, string $nodeTypeFilter = '', int $depth = 0, NodeInterface $untilNode = null)

Prepares this view to render a list or tree of given node including child nodes.

void
assignFilteredChildNodes(NodeInterface $node, array $matchedNodes, int $outputStyle = self::STYLE_LIST)

Prepares this view to render a list or tree of filtered nodes.

void
collectChildNodeData(array $nodes, NodeInterface $node, string $nodeTypeFilter, int $depth = 0, NodeInterface $untilNode = null, int $recursionPointer = 1)

Collect node data and traverse child nodes

array
collectParentNodeData(NodeInterface $rootNode, array $nodes)

No description

array
collectTreeNodeData(NodeInterface $node, bool $expand = true, array $children = [], bool $hasChildNodes = false, bool $matched = false)

No description

Details

void assignNode(NodeInterface $node, array $propertyNames = ['name', 'path', 'identifier', 'properties', 'nodeType'])

Assigns a node to the NodeView.

Parameters

NodeInterface $node

The node to render

array $propertyNames

Optional list of property names to include in the JSON output

Return Value

void

void assignNodes(array $nodes)

No description

Parameters

array $nodes

Return Value

void

Exceptions

Exception

void assignChildNodes(NodeInterface $node, string $nodeTypeFilter, int $outputStyle = self::STYLE_LIST, int $depth = 0, NodeInterface $untilNode = null)

Prepares this view to render a list or tree of child nodes of the given node.

Parameters

NodeInterface $node

The node to fetch child nodes of

string $nodeTypeFilter

Criteria for filtering the child nodes

int $outputStyle

Either STYLE_TREE or STYLE_list

int $depth

How many levels of childNodes (0 = unlimited)

NodeInterface $untilNode

if given, expand all nodes on the rootline towards $untilNode, no matter what is defined with $depth.

Return Value

void

void assignNodeAndChildNodes(NodeInterface $node, string $nodeTypeFilter = '', int $depth = 0, NodeInterface $untilNode = null)

Prepares this view to render a list or tree of given node including child nodes.

Parameters

NodeInterface $node

The node to fetch child nodes of

string $nodeTypeFilter

Criteria for filtering the child nodes

int $depth

How many levels of childNodes (0 = unlimited)

NodeInterface $untilNode

if given, expand all nodes on the rootline towards $untilNode, no matter what is defined with $depth.

Return Value

void

void assignFilteredChildNodes(NodeInterface $node, array $matchedNodes, int $outputStyle = self::STYLE_LIST)

Prepares this view to render a list or tree of filtered nodes.

Parameters

NodeInterface $node
array $matchedNodes
int $outputStyle

Either STYLE_TREE or STYLE_list

Return Value

void

protected void collectChildNodeData(array $nodes, NodeInterface $node, string $nodeTypeFilter, int $depth = 0, NodeInterface $untilNode = null, int $recursionPointer = 1)

Collect node data and traverse child nodes

Parameters

array $nodes
NodeInterface $node
string $nodeTypeFilter
int $depth

levels of child nodes to fetch. 0 = unlimited

NodeInterface $untilNode

if given, expand all nodes on the rootline towards $untilNode, no matter what is defined with $depth.

int $recursionPointer

current recursion level

Return Value

void

array collectParentNodeData(NodeInterface $rootNode, array $nodes)

No description

Parameters

NodeInterface $rootNode
array $nodes

Return Value

array

array collectTreeNodeData(NodeInterface $node, bool $expand = true, array $children = [], bool $hasChildNodes = false, bool $matched = false)

No description

Parameters

NodeInterface $node
bool $expand
array $children
bool $hasChildNodes
bool $matched

Return Value

array