NodeFactory
class NodeFactory (View source)
This factory creates nodes based on node data. Its main purpose is to assure that nodes created for a certain node data container and context are unique in memory.
Properties
protected Node[] | $nodes | ||
protected ObjectManagerInterface | $objectManager | ||
protected Context | $securityContext | ||
protected ContextFactoryInterface | $contextFactory |
Methods
Creates a node from the given NodeData container.
Get all NodeInterface implementations to check if a configured node class is in there.
Generates a Context that exactly fits the given NodeData Workspace and Dimensions.
Reset the node instances (for testing)
Details
NodeInterface
createFromNodeData(NodeData $nodeData, Context $context)
Creates a node from the given NodeData container.
If this factory has previously created a Node for the given $node and it's dimensions, it will return the same node again.
static array
getNodeInterfaceImplementations(ObjectManagerInterface $objectManager)
Get all NodeInterface implementations to check if a configured node class is in there.
protected NodeInterface|null
filterNodeByContext(NodeInterface $node, Context $context)
Filter a node by the current context.
Will either return the node or NULL if it is not permitted in current context.
Context
createContextMatchingNodeData(NodeData $nodeData)
Generates a Context that exactly fits the given NodeData Workspace and Dimensions.
TODO: We could get more specific about removed and invisible content by adding some more logic here that generates fitting values.
void
reset()
Reset the node instances (for testing)