Node
in package
Live view of one line and its substructures. CONC/CONT lines are not children here: they are joined into {@see value()}. Any access after the node was removed throws {@see \Korin\Gedcom\Exception\DetachedNodeException}.
Table of Contents
Methods
- __construct() : mixed
- addChild() : Node
- all() : array<int, Node>
- children() : array<int, Node>
- document() : Document
- first() : Node|null
- id() : int
- isRemoved() : bool
- level() : int
- 0 for records.
- line() : int|null
- 1-based line in the source; null for nodes added after reading.
- parent() : Node|null
- path() : string
- Path in the corpus grammar, e.g. "@I1@/NAME[1]/SURN"; the index appears only when the tag repeats.
- pointer() : string|null
- Pointer target such as "@I1@" or "@VOID@"; null when the value is not a pointer.
- remove() : void
- setPointer() : self
- setValue() : self
- Replaces the text value; "\n" becomes CONT lines, and old CONC/CONT lines are dropped.
- setValueFor() : self
- tag() : string
- value() : string|null
- Text value with CONC/CONT joined (CONT as "\n") and "@" escaping removed; null for pointers and empty lines.
- valueFor() : string|null
- xref() : string|null
Methods
__construct()
public
__construct(Document $document, int $id) : mixed
Parameters
- $document : Document
- $id : int
addChild()
public
addChild(string $tag[, string|null $value = null ][, int|null $position = null ]) : Node
Parameters
- $tag : string
- $value : string|null = null
- $position : int|null = null
-
0-based index among children(); null appends
Return values
Nodeall()
public
all(string $tag) : array<int, Node>
Parameters
- $tag : string
Return values
array<int, Node>children()
public
children() : array<int, Node>
Return values
array<int, Node> —substructures, without CONC/CONT and unparsable lines
document()
public
document() : Document
Return values
Documentfirst()
public
first(string $tag) : Node|null
Parameters
- $tag : string
Return values
Node|nullid()
public
id() : int
Return values
intisRemoved()
public
isRemoved() : bool
Return values
boollevel()
0 for records.
public
level() : int
Return values
intline()
1-based line in the source; null for nodes added after reading.
public
line() : int|null
Return values
int|nullparent()
public
parent() : Node|null
Return values
Node|nullpath()
Path in the corpus grammar, e.g. "@I1@/NAME[1]/SURN"; the index appears only when the tag repeats.
public
path() : string
Return values
stringpointer()
Pointer target such as "@I1@" or "@VOID@"; null when the value is not a pointer.
public
pointer() : string|null
Return values
string|nullremove()
public
remove() : void
setPointer()
public
setPointer(string $xref) : self
Parameters
- $xref : string
Return values
selfsetValue()
Replaces the text value; "\n" becomes CONT lines, and old CONC/CONT lines are dropped.
public
setValue(string|null $value) : self
Parameters
- $value : string|null
Return values
selfsetValueFor()
public
setValueFor(string|null $value, Version $version) : self
Parameters
- $value : string|null
- $version : Version
Return values
selftag()
public
tag() : string
Return values
stringvalue()
Text value with CONC/CONT joined (CONT as "\n") and "@" escaping removed; null for pointers and empty lines.
public
value() : string|null
Return values
string|nullvalueFor()
public
valueFor(Version $version) : string|null
Parameters
- $version : Version
Return values
string|nullxref()
public
xref() : string|null