DocumentNode
extends CompoundNode
in package
Table of Contents
Properties
- $classes : string[]
- $options : array<string, scalar|scalar[]|null>
- $value : TValue
- $direction : TextDirection|null
- $documentEntry : DocumentEntryNode|null
- $documentPartNodes : array<string, 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 : MetadataNode[]
- Header nodes are rendered in the head of a html page.
- $isRoot : bool
- $language : string|null
- $lastReturnedAnonymousFootnoteNumber : int
- $links : string[]
- $maxFootnoteNumber : int
- $metaTitle : string|null
- $navigationTitle : string|null
- $orphan : bool
- $rootSectionEntry : SectionEntryNode|null
- $template : string|null
- $titleFound : bool
- $tocNodes : TocNode[]
- $variables : (string|Node)[]
- Variables are replacements in a document or project.
Methods
- __construct() : mixed
- addChildNode() : void
- addDocumentPart() : void
- addFootnoteTarget() : int
- addHeaderNode() : void
- addMetaData() : void
- Attaches data about this node that is not part of its content.
- addTocNode() : void
- addVariable() : void
- getChildren() : TValue[]
- getClasses() : string[]
- getClassesString() : string
- getDirection() : TextDirection|null
- getDocumentEntry() : DocumentEntryNode
- getDocumentPartNodes() : array<string, Node[]>
- getFilePath() : string
- getFootnoteTarget() : FootnoteTarget|null
- getFootnoteTargetAnonymous() : FootnoteTarget|null
- getFootnoteTargetByName() : FootnoteTarget|null
- getHash() : string
- getHeaderNodes() : MetadataNode[]
- getLanguage() : string|null
- getLink() : string|null
- getLoggerInformation() : array<string, string>
- getMetaData() : array<string, DataNode>
- getNavigationTitle() : string|null
- getNodes() : array<int, F>
- getOption() : mixed
- getOptions() : array<string, scalar|scalar[]|null>
- getPageTitle() : string|null
- getRootSectionEntry() : SectionEntryNode|null
- getTemplate() : string|null
- getTitle() : TitleNode|null
- getTocNodes() : TocNode[]
- getValue() : TValue
- getVariable() : mixed
- hasDocumentPart() : bool
- hasOption() : bool
- isOrphan() : bool
- isRoot() : bool
- isTitleFound() : bool
- pushChildNode() : void
-
removeNode()
: static
-
replaceNode()
: static
- 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
string[]
$classes
= []
$options
protected
array<string, scalar|scalar[]|null>
$options
= []
$value
protected
TValue
$value
$direction
private
TextDirection|null
$direction
= null
$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, 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
MetadataNode[]
$headerNodes
= []
They contain metadata about the document.
$isRoot
private
bool
$isRoot
= false
$language
private
string|null
$language
= null
$lastReturnedAnonymousFootnoteNumber
private
int
$lastReturnedAnonymousFootnoteNumber
= -1
$links
private
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
$template
private
string|null
$template
= null
$titleFound
private
bool
$titleFound
= false
$tocNodes
private
TocNode[]
$tocNodes
= []
$variables
Variables are replacements in a document or project.
private
(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, Node[] $nodes) : void
Parameters
- $identifier : string
- $nodes : Node[]
addFootnoteTarget()
public
addFootnoteTarget(FootnoteTarget $target) : int
Parameters
- $target : FootnoteTarget
Return values
intaddHeaderNode()
public
addHeaderNode(MetadataNode $node) : void
Parameters
- $node : MetadataNode
addMetaData()
Attaches data about this node that is not part of its content.
public
addMetaData(DataNode $data) : void
Rendered as a data-* attribute where the node's template asks for
it. A name that is already taken gets the new values added to the ones
it has, rather than replaced by them. DataNode
Parameters
- $data : DataNode
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() : TValue[]
Return values
TValue[]getClasses()
public
getClasses() : string[]
Return values
string[]getClassesString()
public
getClassesString() : string
Return values
stringgetDirection()
public
getDirection() : TextDirection|null
Return values
TextDirection|nullgetDocumentEntry()
public
getDocumentEntry() : DocumentEntryNode
Return values
DocumentEntryNodegetDocumentPartNodes()
public
getDocumentPartNodes() : array<string, Node[]>
Return values
array<string, 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() : MetadataNode[]
Return values
MetadataNode[]getLanguage()
public
getLanguage() : string|null
Return values
string|nullgetLink()
public
getLink(string $name) : string|null
Parameters
- $name : string
Return values
string|nullgetLoggerInformation()
public
getLoggerInformation() : array<string, string>
Return values
array<string, string>getMetaData()
public
getMetaData() : array<string, DataNode>
Return values
array<string, DataNode> —keyed by name
getNavigationTitle()
public
getNavigationTitle() : string|null
Return values
string|nullgetNodes()
public
getNodes([class-string $nodeType = Node::class ]) : array<int, F>
Parameters
-
$nodeType
: class-string
= 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|scalar[]|null>
Return values
array<string, scalar|scalar[]|null>getPageTitle()
public
getPageTitle() : string|null
Return values
string|nullgetRootSectionEntry()
public
getRootSectionEntry() : SectionEntryNode|null
Return values
SectionEntryNode|nullgetTemplate()
public
getTemplate() : string|null
Return values
string|nullgetTitle()
public
getTitle() : TitleNode|null
Return values
TitleNode|nullgetTocNodes()
public
getTocNodes() : TocNode[]
Return values
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) : static
Parameters
- $key : int
Return values
staticreplaceNode()
public
replaceNode(int $key, TValue $node) : static
Parameters
- $key : int
- $node : TValue
Return values
staticsetClasses()
Normalizes class names following the rules of identifier-normalization
public
setClasses(string[] $classes) : void
Parameters
- $classes : 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|scalar[]|null> $options) : static
Parameters
- $options : array<string, scalar|scalar[]|null>