class NodeTypeSchemaBuilder (View source)

Renders the Node Type Schema in a format the User Interface understands; additionally pre-calculating node constraints

Methods

create(NodeTypeManager $nodeTypeManager)

No description

array<string, mixed>
generateNodeTypeSchema()

The preprocessed node type schema contains everything we need for the UI:

array<string, mixed>
generateConstraints()

Generate the list of allowed sub-node-types per parent-node-type and child-node-name.

Details

static NodeTypeSchemaBuilder create(NodeTypeManager $nodeTypeManager)

No description

Parameters

NodeTypeManager $nodeTypeManager

Return Value

NodeTypeSchemaBuilder

array<string, mixed> generateNodeTypeSchema()

The preprocessed node type schema contains everything we need for the UI:

  • "nodeTypes" contains the original (merged) node type schema
  • "inheritanceMap.subTypes" contains for every parent type the transitive list of subtypes
  • "constraints" contains for each node type, the list of allowed child node types; normalizing allowlists and excludelists:
    • [node type]
    • nodeTypes:
    • childNodes:
      • [child node name]
      • nodeTypes:

Return Value

array<string, mixed>

the node type schema ready to be used by the JavaScript code

protected array<string, mixed> generateConstraints()

Generate the list of allowed sub-node-types per parent-node-type and child-node-name.

Return Value

array<string, mixed> constraints