class NodeTypeManager (View source)

Manager for node types

Properties

protected array $cachedNodeTypes

Node types, indexed by name

protected array $cachedSubNodeTypes

Node types, indexed by supertype (also including abstract node types)

protected ConfigurationManager $configurationManager
protected string $fallbackNodeTypeName
protected array $fullNodeTypeConfigurations

Methods

getNodeTypes(bool $includeAbstractNodeTypes = true)

Return all registered node types.

getSubNodeTypes(string $superTypeName, bool $includeAbstractNodeTypes = true)

Return all non-abstract node types which have a certain $superType, without the $superType itself.

getNodeType(string $nodeTypeName)

Returns the specified node type (which could be abstract)

bool
hasNodeType(string $nodeTypeName)

Checks if the specified node type exists

createNodeType(string $nodeTypeName)

Creates a new node type

void
loadNodeTypes()

Loads all node types into memory.

void
overrideNodeTypes(array $completeNodeTypeConfiguration)

This method can be used by Functional of Behavioral Tests to completely override the node types known in the system.

loadNodeType(string $nodeTypeName, array $completeNodeTypeConfiguration)

Load one node type, if it is not loaded yet.

array
evaluateSuperTypesConfiguration(array $superTypesConfiguration, array $completeNodeTypeConfiguration)

Evaluates the given superTypes configuation and returns the array of effective superTypes.

evaluateSuperTypeConfiguration(string $superTypeName, bool $enabled, array $completeNodeTypeConfiguration)

Evaluates a single superType configuration and returns the NodeType if enabled.

Details

NodeType[] getNodeTypes(bool $includeAbstractNodeTypes = true)

Return all registered node types.

Parameters

bool $includeAbstractNodeTypes

Whether to include abstract node types, defaults to true

Return Value

NodeType[]

All node types registered in the system, indexed by node type name

NodeType[] getSubNodeTypes(string $superTypeName, bool $includeAbstractNodeTypes = true)

Return all non-abstract node types which have a certain $superType, without the $superType itself.

Parameters

string $superTypeName
bool $includeAbstractNodeTypes

Whether to include abstract node types, defaults to true

Return Value

NodeType[]

Sub node types of the given super type, indexed by node type name

NodeType getNodeType(string $nodeTypeName)

Returns the specified node type (which could be abstract)

Parameters

string $nodeTypeName

Return Value

NodeType

or NULL

Exceptions

NodeTypeNotFoundException

bool hasNodeType(string $nodeTypeName)

Checks if the specified node type exists

Parameters

string $nodeTypeName

Name of the node type

Return Value

bool

true if it exists, otherwise false

NodeType createNodeType(string $nodeTypeName)

Creates a new node type

Parameters

string $nodeTypeName

Unique name of the new node type. Example: "Neos.Neos:Page"

Return Value

NodeType

Exceptions

Exception

protected void loadNodeTypes()

Loads all node types into memory.

Return Value

void

void overrideNodeTypes(array $completeNodeTypeConfiguration)

This method can be used by Functional of Behavioral Tests to completely override the node types known in the system.

In order to reset the node type override, an empty array can be passed in. In this case, the system-node-types are used again.

Parameters

array $completeNodeTypeConfiguration

Return Value

void

protected NodeType loadNodeType(string $nodeTypeName, array $completeNodeTypeConfiguration)

Load one node type, if it is not loaded yet.

Parameters

string $nodeTypeName
array $completeNodeTypeConfiguration

the full node type configuration for all node types

Return Value

NodeType

Exceptions

NodeConfigurationException
NodeTypeIsFinalException
Exception

protected array evaluateSuperTypesConfiguration(array $superTypesConfiguration, array $completeNodeTypeConfiguration)

Evaluates the given superTypes configuation and returns the array of effective superTypes.

Parameters

array $superTypesConfiguration
array $completeNodeTypeConfiguration

Return Value

array

protected NodeType evaluateSuperTypeConfiguration(string $superTypeName, bool $enabled, array $completeNodeTypeConfiguration)

Evaluates a single superType configuration and returns the NodeType if enabled.

Parameters

string $superTypeName
bool $enabled
array $completeNodeTypeConfiguration

Return Value

NodeType

Exceptions

NodeConfigurationException
NodeTypeIsFinalException