‪TYPO3CMS  ‪main
TYPO3\CMS\Core\TypoScript\AST\Node\AbstractChildNode Class Reference
Inheritance diagram for TYPO3\CMS\Core\TypoScript\AST\Node\AbstractChildNode:
TYPO3\CMS\Core\TypoScript\AST\Node\AbstractNode TYPO3\CMS\Core\TypoScript\AST\Node\ChildNodeInterface TYPO3\CMS\Core\TypoScript\AST\Node\NodeInterface TYPO3\CMS\Core\TypoScript\AST\Node\NodeInterface TYPO3\CMS\Core\TypoScript\AST\Node\ChildNode TYPO3\CMS\Core\TypoScript\AST\Node\ReferenceChildNode

Public Member Functions

 __construct (protected string $name)
 
 __clone ()
 
 getName ()
 
 toArray ()
 
 flatten (string $prefix='')
 
- ‪Public Member Functions inherited from ‪TYPO3\CMS\Core\TypoScript\AST\Node\AbstractNode
 __serialize ()
 
 setIdentifier (string $identifier)
 
 updateName (string $name)
 
 getIdentifier ()
 
 addChild (ChildNodeInterface $node)
 
 getChildByName (string $name)
 
 removeChildByName (string $name)
 
 hasChildren ()
 
 getNextChild ()
 
 sortChildren ()
 
 setValue (?string $value)
 
 appendValue (string $value)
 
 getValue ()
 
 isValueNull ()
 
 setPreviousValue (?string $value)
 
 getPreviousValue ()
 
 setOriginalValueTokenStream (?TokenStreamInterface $tokenStream)
 
 getOriginalValueTokenStream ()
 
 addComment (TokenStreamInterface $tokenStream)
 
TokenStreamInterface[] getComments ()
 

Additional Inherited Members

- ‪Protected Member Functions inherited from ‪TYPO3\CMS\Core\TypoScript\AST\Node\AbstractNode
 serialize ()
 
- ‪Protected Attributes inherited from ‪TYPO3\CMS\Core\TypoScript\AST\Node\AbstractNode
string $name
 
array $children = []
 

Detailed Description

Generic child node. Implements common methods of NodeInterface used in all Node classes.

: Internal AST structure.

Definition at line 26 of file AbstractChildNode.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Core\TypoScript\AST\Node\AbstractChildNode::__construct ( protected string  $name)

Definition at line 28 of file AbstractChildNode.php.

Member Function Documentation

◆ __clone()

TYPO3\CMS\Core\TypoScript\AST\Node\AbstractChildNode::__clone ( )

Dereference children on clone(). Used with '<' operator to create a deep-copy of the tree to copy.

Definition at line 34 of file AbstractChildNode.php.

◆ flatten()

TYPO3\CMS\Core\TypoScript\AST\Node\AbstractChildNode::flatten ( string  $prefix = '')

Flatten the tree. A RootNode with a ChildNode "foo" and value "fooValue", with this ChildNode again having a ChildNode "bar" and value "barValue" becomes: [ 'foo' => 'fooValue', 'foo.bar' => 'barValue', ]

Flattening a TypoScript tree is especially used for constants to quickly look up constants when parsing setup node value streams that use T_CONSTANT tokens.

Implements TYPO3\CMS\Core\TypoScript\AST\Node\NodeInterface.

Definition at line 74 of file AbstractChildNode.php.

References TYPO3\CMS\Core\TypoScript\AST\Node\AbstractChildNode\getName(), TYPO3\CMS\Core\TypoScript\AST\Node\AbstractNode\getNextChild(), TYPO3\CMS\Core\TypoScript\AST\Node\AbstractNode\getValue(), and TYPO3\CMS\Core\TypoScript\AST\Node\AbstractNode\isValueNull().

◆ getName()

TYPO3\CMS\Core\TypoScript\AST\Node\AbstractChildNode::getName ( )

◆ toArray()

TYPO3\CMS\Core\TypoScript\AST\Node\AbstractChildNode::toArray ( )

b/w compat method to turn AST into an array. Note we're NOT using magic __toArray() here to avoid calling array-cast of AST by accident: toArray() should be called explicitly if needed, which makes it much easier to drop this b/w compat method when we later want to drop that layer.

Note RootNode always returns an array, while ObjectNode's may return null.

Implements TYPO3\CMS\Core\TypoScript\AST\Node\NodeInterface.

Definition at line 46 of file AbstractChildNode.php.

References TYPO3\CMS\Core\TypoScript\AST\Node\AbstractNode\getNextChild(), and TYPO3\CMS\Core\TypoScript\AST\Node\AbstractNode\hasChildren().