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
protected ContentRepositoryRegistry $contentRepositoryRegistry

Methods

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

Assigns a node to the NodeView.

void
assignNodes(Nodes $nodes)

No description

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

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

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

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

void
assignFilteredChildNodes(Node $node, Nodes $matchedNodes, int $outputStyle = self::STYLE_LIST)

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

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

Collect node data and traverse child nodes

array
collectParentNodeData(Node $rootNode, Nodes $nodes)

No description

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

No description

Details

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

Assigns a node to the NodeView.

Parameters

Node $node

The node to render

array $propertyNames

Optional list of property names to include in the JSON output

Return Value

void

void assignNodes(Nodes $nodes)

No description

Parameters

Nodes $nodes

Return Value

void

Exceptions

Exception

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

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

Parameters

Node $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)

Node $untilNode

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

Return Value

void

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

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

Parameters

Node $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)

Node $untilNode

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

Return Value

void

void assignFilteredChildNodes(Node $node, Nodes $matchedNodes, int $outputStyle = self::STYLE_LIST)

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

Parameters

Node $node
Nodes $matchedNodes
int $outputStyle

Either STYLE_TREE or STYLE_list

Return Value

void

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

Collect node data and traverse child nodes

Parameters

array $nodes
Node $node
?string $nodeTypeFilter
int $depth

levels of child nodes to fetch. 0 = unlimited

Node $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(Node $rootNode, Nodes $nodes)

No description

Parameters

Node $rootNode
Nodes $nodes

Return Value

array

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

No description

Parameters

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

Return Value

array