Identifiers
in package
implements
NodeRule
EXID goes back to the 5.5.1 tag its TYPE names, where the record has that tag in 5.5.1 and converting up again gives the same EXID:
- EXID x, TYPE https://gedcom.io/terms/v7/AFN → AFN x;
- EXID xyz, TYPE https://gedcom.io/terms/v7/RFN#123abc → RFN xyz:123abc, without a fragment RFN xyz (not for a value with ":", which would read as one with a fragment);
- EXID x, TYPE https://gedcom.io/terms/v7/RIN#<HEAD.SOUR> → RIN x (without a fragment when the file has no HEAD.SOUR): the identifier of the program that wrote the file.
Any other EXID, or one on a record without that tag in 5.5.1, is kept as the extension _EXID with its TYPE (KL2001): REFN, a number the user assigned, would read as another kind of identifier, and would stay REFN when converted up again. Extensions are left alone.
Table of Contents
Interfaces
- NodeRule
- A rule for one structure at a time. Rules that look at every line of a record are grouped in {@see Rule\Nodes}, which walks each record once for all of them.
Methods
- needsPrepass() : bool
- Whether the rule needs Context::prepass(): facts about the whole input before the first record.
- node() : bool
- Converts one structure (a record or a substructure; never a CONC/CONT line) with one of the rule's tags, as the structure is tagged when the walk reaches it, in place. Its substructures are visited after it, as they are when this returns.
- tags() : array<int, string>|null
Methods
needsPrepass()
Whether the rule needs Context::prepass(): facts about the whole input before the first record.
public
needsPrepass() : bool
Return values
boolnode()
Converts one structure (a record or a substructure; never a CONC/CONT line) with one of the rule's tags, as the structure is tagged when the walk reaches it, in place. Its substructures are visited after it, as they are when this returns.
public
node(Document $document, int $id, Context $context) : bool
Parameters
Return values
bool —false when the rule removed the structure: the rules after it and its substructures are skipped
tags()
public
tags() : array<int, string>|null
Return values
array<int, string>|null —the tags of the structures the rule converts; null for every structure