‪TYPO3CMS  ‪main
TYPO3\CMS\Core\TypoScript\AST\Node\RootNode Class Reference
Inheritance diagram for TYPO3\CMS\Core\TypoScript\AST\Node\RootNode:
TYPO3\CMS\Core\TypoScript\AST\Node\AbstractNode TYPO3\CMS\Core\TypoScript\AST\Node\NodeInterface

Public Member Functions

 __clone ()
 
 getName ()
 
 updateName (string $name)
 
 setValue (?string $value)
 
 appendValue (string $value)
 
 getValue ()
 
 isValueNull ()
 
array< string, toArray():array { $result=[];foreach( $this->getNextChild() as $child) { $childName=$child-> getName ()
 
 flatten (string $prefix='')
 
- ‪Public Member Functions inherited from ‪TYPO3\CMS\Core\TypoScript\AST\Node\AbstractNode
 __serialize ()
 
 setIdentifier (string $identifier)
 
 getIdentifier ()
 
 addChild (ChildNodeInterface $node)
 
 getChildByName (string $name)
 
 removeChildByName (string $name)
 
 hasChildren ()
 
 getNextChild ()
 
 sortChildren ()
 
 setPreviousValue (?string $value)
 
 getPreviousValue ()
 
 setOriginalValueTokenStream (?TokenStreamInterface $tokenStream)
 
 getOriginalValueTokenStream ()
 
 addComment (TokenStreamInterface $tokenStream)
 
TokenStreamInterface[] getComments ()
 
- ‪Public Member Functions inherited from ‪TYPO3\CMS\Core\TypoScript\AST\Node\NodeInterface
 toArray ()
 

Public Attributes

if($child instanceof ReferenceChildNodeelse
 
if($childValue !==null) $grandChildren = $child->toArray()
 
if($grandChildren !==null) return $result
 

Protected Member Functions

 serialize ()
 

Additional Inherited Members

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

Detailed Description

AST entry node.

: Internal AST structure.

Definition at line 25 of file RootNode.php.

Member Function Documentation

◆ __clone()

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

Attempting to clone the RootNode indicates a bug in AstBuilder. It should never happen.

Definition at line 31 of file RootNode.php.

◆ appendValue()

TYPO3\CMS\Core\TypoScript\AST\Node\RootNode::appendValue ( string  $value)

Reimplemented from TYPO3\CMS\Core\TypoScript\AST\Node\AbstractNode.

Definition at line 61 of file RootNode.php.

◆ flatten()

TYPO3\CMS\Core\TypoScript\AST\Node\RootNode::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 101 of file RootNode.php.

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

◆ getName() [1/2]

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

Helper methods for node name.

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

Definition at line 46 of file RootNode.php.

◆ getName() [2/2]

array<string, toArray(): array { $result = []; foreach ($this->getNextChild() as $child) { $childName = $child-> TYPO3\CMS\Core\TypoScript\AST\Node\RootNode::getName ( )
Returns
‪array<string, mixed>

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

◆ getValue()

TYPO3\CMS\Core\TypoScript\AST\Node\RootNode::getValue ( )

Reimplemented from TYPO3\CMS\Core\TypoScript\AST\Node\AbstractNode.

Definition at line 66 of file RootNode.php.

◆ isValueNull()

TYPO3\CMS\Core\TypoScript\AST\Node\RootNode::isValueNull ( )

Reimplemented from TYPO3\CMS\Core\TypoScript\AST\Node\AbstractNode.

Definition at line 71 of file RootNode.php.

◆ serialize()

TYPO3\CMS\Core\TypoScript\AST\Node\RootNode::serialize ( )
protected

RootNode has no properties to cache, just children.

Reimplemented from TYPO3\CMS\Core\TypoScript\AST\Node\AbstractNode.

Definition at line 39 of file RootNode.php.

References TYPO3\CMS\Core\TypoScript\AST\Node\AbstractNode\$children.

◆ setValue()

TYPO3\CMS\Core\TypoScript\AST\Node\RootNode::setValue ( ?string  $value)

Helper methods for value.

Reimplemented from TYPO3\CMS\Core\TypoScript\AST\Node\AbstractNode.

Definition at line 56 of file RootNode.php.

◆ updateName()

TYPO3\CMS\Core\TypoScript\AST\Node\RootNode::updateName ( string  $name)

This forces $this->name NOT to be readonly. Used with '<' operator on tree root to copy: foo = value bar < foo The 'foo' object node is copied, but added to AST as name 'bar'

Reimplemented from TYPO3\CMS\Core\TypoScript\AST\Node\AbstractNode.

Definition at line 51 of file RootNode.php.

Member Data Documentation

◆ $grandChildren

if ( $childValue !==null) TYPO3\CMS\Core\TypoScript\AST\Node\RootNode::$grandChildren = $child->toArray()

Definition at line 93 of file RootNode.php.

◆ $result

if ( $grandChildren !==null) return TYPO3\CMS\Core\TypoScript\AST\Node\RootNode::$result

Definition at line 98 of file RootNode.php.

◆ else

if ( $child instanceof ReferenceChildNode) TYPO3\CMS\Core\TypoScript\AST\Node\RootNode::else
Initial value:
{
$childValue = $child->getValue()

Definition at line 87 of file RootNode.php.