NodeTemplateConverter
class NodeTemplateConverter extends NodeConverter (View source)
An Object Converter for NodeTemplates.
Constants
REMOVED_CONTENT_SHOWN |
|
INVISIBLE_CONTENT_SHOWN |
|
EXTRACT_CONTENT_TYPE_PATTERN |
A pattern that separates the node content object type from the node type |
Properties
protected array | $sourceTypes | ||
protected Context | $securityContext | from NodeConverter | |
protected ObjectManagerInterface | $objectManager | from NodeConverter | |
protected PropertyMapper | $propertyMapper | from NodeConverter | |
protected ContextFactoryInterface | $contextFactory | from NodeConverter | |
protected NodeFactory | $nodeFactory | from NodeConverter | |
protected NodeTypeManager | $nodeTypeManager | ||
protected NodeServiceInterface | $nodeService | from NodeConverter | |
protected string | $targetType | ||
protected int | $priority |
Methods
Converts the specified node path into a Node.
Iterates through the given $properties setting them on the specified $node using the appropriate TypeConverters.
Prepares the context properties for the nodes based on the given workspace and dimensions
Detects the requested node type and returns a corresponding NodeType instance.
Details
mixed
convertFrom(string|array $source, string $targetType = null, array $subProperties = [], PropertyMappingConfigurationInterface $configuration = null)
Converts the specified node path into a Node.
The node path must be an absolute context node path and can be specified as a string or as an array item with the key "__contextNodePath". The latter case is for updating existing nodes.
This conversion method supports creation of new nodes because new nodes
Also note that the context's "current node" is not affected by this object converter, you will need to set it to whatever node your "current" node is, if any.
All elements in the source array which start with two underscores (like __contextNodePath) are specially treated by this converter.
All elements in the source array which start with a single underscore (like _hidden) are directly* set on the Node object.
All other elements, not being prefixed with underscore, are properties of the node.
protected void
setNodeProperties(object $nodeLike, NodeType $nodeType, array $properties, Context $context, PropertyMappingConfigurationInterface $configuration = null)
Iterates through the given $properties setting them on the specified $node using the appropriate TypeConverters.
protected array
prepareContextProperties(string $workspaceName, PropertyMappingConfigurationInterface $configuration = null, array $dimensions = null)
Prepares the context properties for the nodes based on the given workspace and dimensions
protected NodeType
extractNodeType(string $targetType, array $source)
Detects the requested node type and returns a corresponding NodeType instance.