Korin API

Node
in package

Read onlyYes
FinalYes

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
Node

all()

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

first()

public first(string $tag) : Node|null
Parameters
$tag : string
Return values
Node|null

id()

public id() : int
Return values
int

isRemoved()

public isRemoved() : bool
Return values
bool

level()

0 for records.

public level() : int
Return values
int

line()

1-based line in the source; null for nodes added after reading.

public line() : int|null
Return values
int|null

path()

Path in the corpus grammar, e.g. "@I1@/NAME[1]/SURN"; the index appears only when the tag repeats.

public path() : string
Return values
string

pointer()

Pointer target such as "@I1@" or "@VOID@"; null when the value is not a pointer.

public pointer() : string|null
Return values
string|null

remove()

public remove() : void

setPointer()

public setPointer(string $xref) : self
Parameters
$xref : string
Return values
self

setValue()

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
self

setValueFor()

public setValueFor(string|null $value, Version $version) : self
Parameters
$value : string|null
$version : Version
Return values
self

tag()

public tag() : string
Return values
string

value()

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|null

valueFor()

public valueFor(Version $version) : string|null
Parameters
$version : Version
Return values
string|null

xref()

public xref() : string|null
Return values
string|null
On this page

Search results