TYPO3CMS  8
 All Classes Namespaces Files Functions Variables Pages
NodeFactory Class Reference

Public Member Functions

 __construct ()
 

Protected Member Functions

 registerAdditionalNodeTypesFromConfiguration ()
 
 initializeNodeResolver ()
 
 instantiate ($className, array $data)
 

Protected Attributes

 $nodeTypes
 
 $nodeResolver = []
 

Detailed Description

Create an element object depending on type.

Definition at line 22 of file NodeFactory.php.

Constructor & Destructor Documentation

__construct ( )

Set up factory. Initialize additionally registered nodes.

Definition at line 80 of file NodeFactory.php.

References NodeFactory\initializeNodeResolver(), and NodeFactory\registerAdditionalNodeTypesFromConfiguration().

Member Function Documentation

initializeNodeResolver ( )
protected

Add resolver and add them sorted to a local property. This can be used to manipulate the nodeName to class resolution with own code.

Exceptions
Exceptionif configuration is incomplete or two resolver with identical priorities are registered

Definition at line 188 of file NodeFactory.php.

References $GLOBALS, and NodeFactory\$nodeResolver.

Referenced by NodeFactory\__construct().

instantiate (   $className,
array  $data 
)
protected

Instantiate given class name

Parameters
string$classNameGiven class name
array$dataMain data array
Returns
object

Definition at line 229 of file NodeFactory.php.

References GeneralUtility\makeInstance().

registerAdditionalNodeTypesFromConfiguration ( )
protected

Add node types from nodeRegistry to $this->nodeTypes. This can be used to add new render types or to overwrite existing node types. The registered class must implement the NodeInterface and will be called if a node with this renderType is rendered.

Exceptions
Exceptionif configuration is incomplete or two nodes with identical priorities are registered

Definition at line 145 of file NodeFactory.php.

References $GLOBALS.

Referenced by NodeFactory\__construct().

Member Data Documentation

$nodeResolver = []
protected

Definition at line 75 of file NodeFactory.php.

Referenced by NodeFactory\initializeNodeResolver().

$nodeTypes
protected
Initial value:
= [
'flex' => Container\FlexFormEntryContainer::class

Definition at line 29 of file NodeFactory.php.