DocumentNode
extends CompoundNode
in package
FinalYes
Table of Contents
Properties
- $classes : array<string|int, string>
- $options : array<string, scalar|null>
- $value : TValue
- $documentEntry : DocumentEntryNode|null
- $documentPartNodes : array<string, array<string|int, Node>>
- Nodes that can be rendered in a special section of the page like the menu or the footer
- $filePath : string
- $footnoteTargets : array<int, FootnoteTarget>
- $hash : string
- $headerNodes : array<string|int, MetadataNode>
- Header nodes are rendered in the head of a html page.
- $isRoot : bool
- $lastReturnedAnonymousFootnoteNumber : int
- $links : array<string|int, string>
- $maxFootnoteNumber : int
- $metaTitle : string|null
- $navigationTitle : string|null
- $orphan : bool
- $rootSectionEntry : SectionEntryNode|null
- $titleFound : bool
- $tocNodes : array<string|int, TocNode>
- $variables : array<string|int, string|Node>
- Variables are replacements in a document or project.
Methods
- __construct() : mixed
- addChildNode() : void
- addDocumentPart() : void
- addFootnoteTarget() : int
- addHeaderNode() : void
- addTocNode() : void
- addVariable() : void
- getChildren() : array<string|int, TValue>
- getClasses() : array<string|int, string>
- getClassesString() : string
- getDocumentEntry() : DocumentEntryNode
- getDocumentPartNodes() : array<string, array<string|int, Node>>
- getFilePath() : string
- getFootnoteTarget() : FootnoteTarget|null
- getFootnoteTargetAnonymous() : FootnoteTarget|null
- getFootnoteTargetByName() : FootnoteTarget|null
- getHash() : string
- getHeaderNodes() : array<string|int, MetadataNode>
- getLink() : string|null
- getLoggerInformation() : array<string, string>
- getNavigationTitle() : string|null
- getNodes() : array<int, F>
- getOption() : mixed
- getOptions() : array<string, scalar|null>
- getPageTitle() : string|null
- getRootSectionEntry() : SectionEntryNode|null
- getTitle() : TitleNode|null
- getTocNodes() : array<string|int, TocNode>
- getValue() : TValue
- getVariable() : mixed
- hasDocumentPart() : bool
- hasOption() : bool
- isOrphan() : bool
- isRoot() : bool
- isTitleFound() : bool
- pushChildNode() : void
- removeNode() : self
- replaceNode() : self
- setClasses() : void
- Normalizes class names following the rules of identifier-normalization
- setDocumentEntry() : DocumentNode
- setLinks() : void
- setMetaTitle() : void
- setOrphan() : DocumentNode
- setRootSectionEntry() : void
- setTitleFound() : void
- setValue() : void
- withIsRoot() : DocumentNode
- withKeepExistingOptions() : static
- Adds $options as default options without overriding any options already set.
- withOptions() : static
Properties
$classes
protected
array<string|int, string>
$classes
= []
$options
protected
array<string, scalar|null>
$options
= []
$value
protected
TValue
$value
$documentEntry
private
DocumentEntryNode|null
$documentEntry
= null
$documentPartNodes
Nodes that can be rendered in a special section of the page like the menu or the footer
private
array<string, array<string|int, Node>>
$documentPartNodes
= []
$filePath read-only
private
string
$filePath
$footnoteTargets
private
array<int, FootnoteTarget>
$footnoteTargets
= []
$hash read-only
private
string
$hash
$headerNodes
Header nodes are rendered in the head of a html page.
private
array<string|int, MetadataNode>
$headerNodes
= []
They contain metadata about the document.
$isRoot
private
bool
$isRoot
= false
$lastReturnedAnonymousFootnoteNumber
private
int
$lastReturnedAnonymousFootnoteNumber
= -1
$links
private
array<string|int, string>
$links
$maxFootnoteNumber
private
int
$maxFootnoteNumber
= 0
$metaTitle
private
string|null
$metaTitle
= null
$navigationTitle
private
string|null
$navigationTitle
= null
$orphan
private
bool
$orphan
= false
$rootSectionEntry
private
SectionEntryNode|null
$rootSectionEntry
= null
$titleFound
private
bool
$titleFound
= false
$tocNodes
private
array<string|int, TocNode>
$tocNodes
= []
$variables
Variables are replacements in a document or project.
private
array<string|int, string|Node>
$variables
= []
The easiest example is the replace-directive that allows textual replacements in the document. But also other directives may be prefixed with a name to replace a certain value in the text.
Methods
__construct()
public
__construct(string $hash, string $filePath) : mixed
Parameters
- $hash : string
- $filePath : string
addChildNode()
public
addChildNode(TValue $node) : void
Parameters
- $node : TValue
addDocumentPart()
public
addDocumentPart(string $identifier, array<string|int, Node> $nodes) : void
Parameters
- $identifier : string
- $nodes : array<string|int, Node>
addFootnoteTarget()
public
addFootnoteTarget(FootnoteTarget $target) : int
Parameters
- $target : FootnoteTarget
Return values
intaddHeaderNode()
public
addHeaderNode(MetadataNode $node) : void
Parameters
- $node : MetadataNode
addTocNode()
public
addTocNode(TocNode $tocNode) : void
Parameters
- $tocNode : TocNode
addVariable()
public
addVariable(string $name, string|Node $value) : void
Parameters
- $name : string
- $value : string|Node
getChildren()
public
getChildren() : array<string|int, TValue>
Return values
array<string|int, TValue>getClasses()
public
getClasses() : array<string|int, string>
Return values
array<string|int, string>getClassesString()
public
getClassesString() : string
Return values
stringgetDocumentEntry()
public
getDocumentEntry() : DocumentEntryNode
Return values
DocumentEntryNodegetDocumentPartNodes()
public
getDocumentPartNodes() : array<string, array<string|int, Node>>
Return values
array<string, array<string|int, Node>>getFilePath()
public
getFilePath() : string
Return values
stringgetFootnoteTarget()
public
getFootnoteTarget(int $number) : FootnoteTarget|null
Parameters
- $number : int
Return values
FootnoteTarget|nullgetFootnoteTargetAnonymous()
public
getFootnoteTargetAnonymous() : FootnoteTarget|null
Return values
FootnoteTarget|nullgetFootnoteTargetByName()
public
getFootnoteTargetByName(string $name) : FootnoteTarget|null
Parameters
- $name : string
Return values
FootnoteTarget|nullgetHash()
public
getHash() : string
Return values
stringgetHeaderNodes()
public
getHeaderNodes() : array<string|int, MetadataNode>
Return values
array<string|int, MetadataNode>getLink()
public
getLink(string $name) : string|null
Parameters
- $name : string
Return values
string|nullgetLoggerInformation()
public
getLoggerInformation() : array<string, string>
Return values
array<string, string>getNavigationTitle()
public
getNavigationTitle() : string|null
Return values
string|nullgetNodes()
public
getNodes([F> $nodeType = Node::class ]) : array<int, F>
Parameters
- $nodeType : F> = Node::class
Return values
array<int, F>getOption()
public
getOption(string $name[, TType|null $default = null ]) : mixed
Parameters
- $name : string
- $default : TType|null = null
Tags
getOptions()
public
getOptions() : array<string, scalar|null>
Return values
array<string, scalar|null>getPageTitle()
public
getPageTitle() : string|null
Return values
string|nullgetRootSectionEntry()
public
getRootSectionEntry() : SectionEntryNode|null
Return values
SectionEntryNode|nullgetTitle()
public
getTitle() : TitleNode|null
Return values
TitleNode|nullgetTocNodes()
public
getTocNodes() : array<string|int, TocNode>
Return values
array<string|int, TocNode>getValue()
public
getValue() : TValue
Return values
TValuegetVariable()
public
getVariable(string $name, TType $default) : mixed
Parameters
- $name : string
- $default : TType
Tags
hasDocumentPart()
public
hasDocumentPart(string $identifier) : bool
Parameters
- $identifier : string
Return values
boolhasOption()
public
hasOption(string $name) : bool
Parameters
- $name : string
Return values
boolisOrphan()
public
isOrphan() : bool
Return values
boolisRoot()
public
isRoot() : bool
Return values
boolisTitleFound()
public
isTitleFound() : bool
Return values
boolpushChildNode()
public
pushChildNode(TValue $node) : void
Parameters
- $node : TValue
removeNode()
public
removeNode(int $key) : self
Parameters
- $key : int
Tags
Return values
selfreplaceNode()
public
replaceNode(int $key, TValue $node) : self
Parameters
- $key : int
- $node : TValue
Tags
Return values
selfsetClasses()
Normalizes class names following the rules of identifier-normalization
public
setClasses(array<string|int, string> $classes) : void
Parameters
- $classes : array<string|int, string>
Tags
setDocumentEntry()
public
setDocumentEntry(DocumentEntryNode $documentEntry) : DocumentNode
Parameters
- $documentEntry : DocumentEntryNode
Return values
DocumentNodesetLinks()
public
setLinks(array<string, string> $links) : void
Parameters
- $links : array<string, string>
setMetaTitle()
public
setMetaTitle(string $metaTitle) : void
Parameters
- $metaTitle : string
setOrphan()
public
setOrphan(bool $orphan) : DocumentNode
Parameters
- $orphan : bool
Return values
DocumentNodesetRootSectionEntry()
public
setRootSectionEntry(SectionEntryNode|null $rootSectionEntry) : void
Parameters
- $rootSectionEntry : SectionEntryNode|null
setTitleFound()
public
setTitleFound(bool $titleFound) : void
Parameters
- $titleFound : bool
setValue()
public
setValue(TValue $value) : void
Parameters
- $value : TValue
withIsRoot()
public
withIsRoot(bool $isRoot) : DocumentNode
Parameters
- $isRoot : bool
Return values
DocumentNodewithKeepExistingOptions()
Adds $options as default options without overriding any options already set.
public
withKeepExistingOptions(array<string, scalar|null> $options) : static
Parameters
- $options : array<string, scalar|null>
Return values
staticwithOptions()
public
withOptions(array<string, scalar|null> $options) : static
Parameters
- $options : array<string, scalar|null>