‪TYPO3CMS  ‪main
TYPO3\CMS\Core\TypoScript\IncludeTree\IncludeNode\AbstractInclude Class Reference
Inheritance diagram for TYPO3\CMS\Core\TypoScript\IncludeTree\IncludeNode\AbstractInclude:
TYPO3\CMS\Core\TypoScript\IncludeTree\IncludeNode\IncludeInterface TYPO3\CMS\Core\TypoScript\IncludeTree\IncludeNode\AbstractConditionInclude TYPO3\CMS\Core\TypoScript\IncludeTree\IncludeNode\AtImportInclude TYPO3\CMS\Core\TypoScript\IncludeTree\IncludeNode\DefaultTypoScriptInclude TYPO3\CMS\Core\TypoScript\IncludeTree\IncludeNode\DefaultTypoScriptMagicKeyInclude TYPO3\CMS\Core\TypoScript\IncludeTree\IncludeNode\ExtensionStaticInclude TYPO3\CMS\Core\TypoScript\IncludeTree\IncludeNode\FileInclude TYPO3\CMS\Core\TypoScript\IncludeTree\IncludeNode\IncludeStaticFileDatabaseInclude TYPO3\CMS\Core\TypoScript\IncludeTree\IncludeNode\IncludeStaticFileFileInclude TYPO3\CMS\Core\TypoScript\IncludeTree\IncludeNode\IncludeTyposcriptInclude TYPO3\CMS\Core\TypoScript\IncludeTree\IncludeNode\RootInclude TYPO3\CMS\Core\TypoScript\IncludeTree\IncludeNode\SegmentInclude TYPO3\CMS\Core\TypoScript\IncludeTree\IncludeNode\SiteInclude TYPO3\CMS\Core\TypoScript\IncludeTree\IncludeNode\SiteTemplateInclude TYPO3\CMS\Core\TypoScript\IncludeTree\IncludeNode\StringInclude TYPO3\CMS\Core\TypoScript\IncludeTree\IncludeNode\SysTemplateInclude TYPO3\CMS\Core\TypoScript\IncludeTree\IncludeNode\TsConfigInclude

Public Member Functions

 __serialize ()
 
 getType ()
 
 setIdentifier (string $identifier)
 
 getIdentifier ()
 
 setName (string $name)
 
 getName ()
 
 setPath (string $path)
 
 getPath ()
 
 addChild (IncludeInterface $node)
 
 hasChildren ()
 
 getNextChild ()
 
 isSysTemplateRecord ()
 
 setLineStream (?LineStream $lineStream)
 
 getLineStream ()
 
 setOriginalLine (LineInterface $line)
 
 getOriginalLine ()
 
 setSplit ()
 
 isSplit ()
 
 setRoot (bool $root)
 
 isRoot ()
 
 setClear (bool $clear)
 
 isClear ()
 
 setPid (int $pid)
 
 getPid ()
 

Protected Member Functions

 serialize ()
 

Protected Attributes

string $name = ''
 
string $path = ''
 
array $children = []
 
LineStream $lineStream = null
 
LineInterface $originalTokenLine = null
 
bool $isSplit = false
 
bool $root = false
 
bool $clear = false
 
int $pid = null
 

Private Attributes

string $identifier = null
 

Detailed Description

Base implementation of IncludeInterface.

: Internal tree structure.

Definition at line 28 of file AbstractInclude.php.

Member Function Documentation

◆ __serialize()

TYPO3\CMS\Core\TypoScript\IncludeTree\IncludeNode\AbstractInclude::__serialize ( )
final

When storing to cache, we only store FE relevant properties and skip things like "name", "identifier" and friends. We also don't need the LineStream when a node is split.

Definition at line 50 of file AbstractInclude.php.

References TYPO3\CMS\Core\TypoScript\IncludeTree\IncludeNode\AbstractInclude\serialize().

◆ addChild()

TYPO3\CMS\Core\TypoScript\IncludeTree\IncludeNode\AbstractInclude::addChild ( IncludeInterface  $node)

Child maintenance methods.

Implements TYPO3\CMS\Core\TypoScript\IncludeTree\IncludeNode\IncludeInterface.

Definition at line 122 of file AbstractInclude.php.

◆ getIdentifier()

TYPO3\CMS\Core\TypoScript\IncludeTree\IncludeNode\AbstractInclude::getIdentifier ( )

◆ getLineStream()

TYPO3\CMS\Core\TypoScript\IncludeTree\IncludeNode\AbstractInclude::getLineStream ( )

◆ getName()

TYPO3\CMS\Core\TypoScript\IncludeTree\IncludeNode\AbstractInclude::getName ( )

◆ getNextChild()

TYPO3\CMS\Core\TypoScript\IncludeTree\IncludeNode\AbstractInclude::getNextChild ( )

◆ getOriginalLine()

TYPO3\CMS\Core\TypoScript\IncludeTree\IncludeNode\AbstractInclude::getOriginalLine ( )

◆ getPath()

TYPO3\CMS\Core\TypoScript\IncludeTree\IncludeNode\AbstractInclude::getPath ( )

◆ getPid()

TYPO3\CMS\Core\TypoScript\IncludeTree\IncludeNode\AbstractInclude::getPid ( )

◆ getType()

TYPO3\CMS\Core\TypoScript\IncludeTree\IncludeNode\AbstractInclude::getType ( )

A human-readable string derived from class name - Used in BE template analyzer

Implements TYPO3\CMS\Core\TypoScript\IncludeTree\IncludeNode\IncludeInterface.

Definition at line 73 of file AbstractInclude.php.

◆ hasChildren()

TYPO3\CMS\Core\TypoScript\IncludeTree\IncludeNode\AbstractInclude::hasChildren ( )

◆ isClear()

◆ isRoot()

◆ isSplit()

◆ isSysTemplateRecord()

TYPO3\CMS\Core\TypoScript\IncludeTree\IncludeNode\AbstractInclude::isSysTemplateRecord ( )

True for IncludeTypoScriptInclude - this node represents a sys_template record. When true, methods like isRoot() and isClear() are relevant.

Implements TYPO3\CMS\Core\TypoScript\IncludeTree\IncludeNode\IncludeInterface.

Reimplemented in TYPO3\CMS\Core\TypoScript\IncludeTree\IncludeNode\SysTemplateInclude.

Definition at line 139 of file AbstractInclude.php.

◆ serialize()

◆ setClear()

TYPO3\CMS\Core\TypoScript\IncludeTree\IncludeNode\AbstractInclude::setClear ( bool  $clear)

Set to true for IncludeTypoScriptInclude's (sys_template records) when "clear constants" or "clear setup" is set. Depends on context if currently constants or setup are parsed.

Implements TYPO3\CMS\Core\TypoScript\IncludeTree\IncludeNode\IncludeInterface.

Definition at line 184 of file AbstractInclude.php.

References TYPO3\CMS\Core\TypoScript\IncludeTree\IncludeNode\AbstractInclude\$clear.

◆ setIdentifier()

TYPO3\CMS\Core\TypoScript\IncludeTree\IncludeNode\AbstractInclude::setIdentifier ( string  $identifier)

An identifier for this include. Typically, a hash of some kind. This identifier is unique within the tree, by being created from the parent identifier plus something unique for this level like a counter. This identifier is used in the backend, when referencing single includes to be rendered. Calculating identifiers is initiated by calling setIdentifier() on RootNode, which will recurse the tree. Call this on the final tree, after include calculation finished, so include building itself does not need to fiddle with identifier updates. Note this value is skipped when persisting to caches since it's a Backend related thing that does not use cached context: When retrieving includes from cache (e.g. in Frontend), the identifier is null and calling the getter will throw an exception.

Implements TYPO3\CMS\Core\TypoScript\IncludeTree\IncludeNode\IncludeInterface.

Definition at line 80 of file AbstractInclude.php.

References TYPO3\CMS\Core\TypoScript\IncludeTree\IncludeNode\AbstractInclude\$identifier, and TYPO3\CMS\Core\TypoScript\IncludeTree\IncludeNode\AbstractInclude\getNextChild().

◆ setLineStream()

TYPO3\CMS\Core\TypoScript\IncludeTree\IncludeNode\AbstractInclude::setLineStream ( ?LineStream  $lineStream)

◆ setName()

TYPO3\CMS\Core\TypoScript\IncludeTree\IncludeNode\AbstractInclude::setName ( string  $name)

A human-readable version of the identifier: Used in backend tree rendering.

Implements TYPO3\CMS\Core\TypoScript\IncludeTree\IncludeNode\IncludeInterface.

Reimplemented in TYPO3\CMS\Core\TypoScript\IncludeTree\IncludeNode\RootInclude.

Definition at line 102 of file AbstractInclude.php.

References TYPO3\CMS\Core\TypoScript\IncludeTree\IncludeNode\AbstractInclude\$name.

◆ setOriginalLine()

TYPO3\CMS\Core\TypoScript\IncludeTree\IncludeNode\AbstractInclude::setOriginalLine ( LineInterface  $line)

When an imports are handled, such a line is substituted by the included content. To be able to still output the original line, it is parked here. Relevant in backend tree and source display only.

Implements TYPO3\CMS\Core\TypoScript\IncludeTree\IncludeNode\IncludeInterface.

Definition at line 154 of file AbstractInclude.php.

◆ setPath()

TYPO3\CMS\Core\TypoScript\IncludeTree\IncludeNode\AbstractInclude::setPath ( string  $path)

This is set to non-empty string for includes that represent files. The file location is stored here, typically something like "EXT:my_extension/path/to/foo.typoscript". This is used when resolving file includes relative to a parent include, so a potential child node knows where to look relative to its parent path. Note this value is skipped when persisting to caches: The parent path information is no longer needed when a tree is fetched from cache since all children were attached already and don't need to be recalculated depending on their parent path value.

Implements TYPO3\CMS\Core\TypoScript\IncludeTree\IncludeNode\IncludeInterface.

Definition at line 112 of file AbstractInclude.php.

References TYPO3\CMS\Core\TypoScript\IncludeTree\IncludeNode\AbstractInclude\$path.

◆ setPid()

TYPO3\CMS\Core\TypoScript\IncludeTree\IncludeNode\AbstractInclude::setPid ( int  $pid)

Set to the pid of IncludeTypoScriptInclude's (sys_template records). Relevant in backend tree rendering only.

Implements TYPO3\CMS\Core\TypoScript\IncludeTree\IncludeNode\IncludeInterface.

Definition at line 194 of file AbstractInclude.php.

References TYPO3\CMS\Core\TypoScript\IncludeTree\IncludeNode\AbstractInclude\$pid.

◆ setRoot()

TYPO3\CMS\Core\TypoScript\IncludeTree\IncludeNode\AbstractInclude::setRoot ( bool  $root)

Set to true for IncludeTypoScriptInclude's (sys_template records) when "root" flag is set.

Implements TYPO3\CMS\Core\TypoScript\IncludeTree\IncludeNode\IncludeInterface.

Definition at line 174 of file AbstractInclude.php.

References TYPO3\CMS\Core\TypoScript\IncludeTree\IncludeNode\AbstractInclude\$root.

◆ setSplit()

TYPO3\CMS\Core\TypoScript\IncludeTree\IncludeNode\AbstractInclude::setSplit ( )

When included line streams contain conditions or imports, the node is split into children that contain single segments of the source. The node itself is then just a container and the LineStream attached is irrelevant for further processing. This flag is set when a line stream is split and the children fully represent the source.

Implements TYPO3\CMS\Core\TypoScript\IncludeTree\IncludeNode\IncludeInterface.

Definition at line 164 of file AbstractInclude.php.

References TYPO3\CMS\Core\TypoScript\IncludeTree\IncludeNode\AbstractInclude\isSplit().

Member Data Documentation

◆ $children

array TYPO3\CMS\Core\TypoScript\IncludeTree\IncludeNode\AbstractInclude::$children = []
protected

◆ $clear

bool TYPO3\CMS\Core\TypoScript\IncludeTree\IncludeNode\AbstractInclude::$clear = false
protected

◆ $identifier

string TYPO3\CMS\Core\TypoScript\IncludeTree\IncludeNode\AbstractInclude::$identifier = null
private

◆ $isSplit

bool TYPO3\CMS\Core\TypoScript\IncludeTree\IncludeNode\AbstractInclude::$isSplit = false
protected

◆ $lineStream

◆ $name

string TYPO3\CMS\Core\TypoScript\IncludeTree\IncludeNode\AbstractInclude::$name = ''
protected

◆ $originalTokenLine

LineInterface TYPO3\CMS\Core\TypoScript\IncludeTree\IncludeNode\AbstractInclude::$originalTokenLine = null
protected

◆ $path

string TYPO3\CMS\Core\TypoScript\IncludeTree\IncludeNode\AbstractInclude::$path = ''
protected

◆ $pid

int TYPO3\CMS\Core\TypoScript\IncludeTree\IncludeNode\AbstractInclude::$pid = null
protected

◆ $root

bool TYPO3\CMS\Core\TypoScript\IncludeTree\IncludeNode\AbstractInclude::$root = false
protected