Individual
extends RecordView
in package
A live view of an INDI record: names, sex, events, and the families it is a child or a spouse in. Values that are not valid for the version read as null; their text stays on {@see node()}.
Table of Contents
Constants
- EVENTS : array<string, true> = ['ADOP' => true, 'BAPM' => true, 'BARM' => true...
- TAG : string = 'INDI'
Properties
- $file : Document|IndexedDocument|null
- $node : Node
Methods
- __construct() : mixed
- addBirth() : Event
- addDeath() : Event
- addEvent() : Event
- Adds an event of the record type; one without a date or place is "Y", it happened. The tree is not changed when the date cannot be written in the version.
- birth() : Event|null
- children() : array<int, Individual>
- death() : Event|null
- editName() : self
- events() : array<int, Event>
- familiesAsChild() : array<int, Family>
- familiesAsSpouse() : array<int, Family>
- familyXrefs() : array<int, string>
- name() : PersonalName|null
- The first NAME.
- names() : array<int, PersonalName>
- node() : Node
- of() : self|null
- parents() : array<int, Individual>
- setName() : self
- Replaces the value of the first NAME, or adds one. Its pieces GIVN, SURN and NSFX that were the parts of the old value follow the new one (removed when the new one has no such part); pieces that said something else, and the other substructures, stay.
- setSex() : self
- sex() : Sex|null
- spouses() : array<int, Individual>
- tagIn() : string
- The tag of the record type in a version.
- typed() : T|null
- xref() : string|null
- eventsOf() : array<int, Event>
- lookUp() : Node|null
- The record of a pointer, or null when there is none of that type.
- pointers() : array<int, string>
- setText() : static
- Replaces the value of the first substructure with this tag, adds one, or removes it for null.
- text() : string|null
- The value of the first substructure with this tag.
- version() : Version
Constants
EVENTS
public
array<string, true>
EVENTS
= ['ADOP' => true, 'BAPM' => true, 'BARM' => true, 'BASM' => true, 'BIRT' => true, 'BLES' => true, 'BURI' => true, 'CENS' => true, 'CHR' => true, 'CHRA' => true, 'CONF' => true, 'CREM' => true, 'DEAT' => true, 'EMIG' => true, 'FCOM' => true, 'GRAD' => true, 'IMMI' => true, 'NATU' => true, 'ORDN' => true, 'PROB' => true, 'RETI' => true, 'WILL' => true, 'EVEN' => true]
individual events of 5.5, 5.5.1, 5.5.5 and 7.0
TAG
public
string
TAG
= 'INDI'
the record's tag; see self::tagIn()
Properties
$file read-only
protected
Document|IndexedDocument|null
$file
$node read-only
protected
Node
$node
Methods
__construct()
public
__construct(Node $node, Document|IndexedDocument|null $file) : mixed
Parameters
- $node : Node
- $file : Document|IndexedDocument|null
-
where the records it points to are; null for a streamed record
addBirth()
public
addBirth([GedcomDate|null $date = null ][, Place|null $place = null ]) : Event
Parameters
- $date : GedcomDate|null = null
- $place : Place|null = null
Return values
EventaddDeath()
public
addDeath([GedcomDate|null $date = null ][, Place|null $place = null ]) : Event
Parameters
- $date : GedcomDate|null = null
- $place : Place|null = null
Return values
EventaddEvent()
Adds an event of the record type; one without a date or place is "Y", it happened. The tree is not changed when the date cannot be written in the version.
public
addEvent(string $tag[, GedcomDate|null $date = null ][, Place|null $place = null ]) : Event
Parameters
- $tag : string
- $date : GedcomDate|null = null
- $place : Place|null = null
Tags
Return values
Eventbirth()
public
birth() : Event|null
Return values
Event|nullchildren()
public
children() : array<int, Individual>
Return values
array<int, Individual> —CHIL of the families of FAMS
death()
public
death() : Event|null
Return values
Event|nulleditName()
public
editName(callable(PersonalName): PersonalName $edit) : self
Parameters
- $edit : callable(PersonalName): PersonalName
-
applied to the first NAME
Return values
selfevents()
public
events(string ...$tags) : array<int, Event>
Parameters
- $tags : string
Return values
array<int, Event> —the events, or those with these tags, in order
familiesAsChild()
public
familiesAsChild() : array<int, Family>
Return values
array<int, Family> —the families of FAMC
familiesAsSpouse()
public
familiesAsSpouse() : array<int, Family>
Return values
array<int, Family> —the families of FAMS
familyXrefs()
public
familyXrefs() : array<int, string>
Return values
array<int, string> —FAMC and FAMS pointers; no other record is read
name()
The first NAME.
public
name() : PersonalName|null
Return values
PersonalName|nullnames()
public
names() : array<int, PersonalName>
Return values
array<int, PersonalName> —every valid NAME, in order
node()
public
node() : Node
Return values
Nodeof()
public
static of(Node $node, Document|IndexedDocument|null $file) : self|null
Parameters
- $node : Node
- $file : Document|IndexedDocument|null
Return values
self|nullparents()
public
parents() : array<int, Individual>
Return values
array<int, Individual> —HUSB and WIFE of the families of FAMC
setName()
Replaces the value of the first NAME, or adds one. Its pieces GIVN, SURN and NSFX that were the parts of the old value follow the new one (removed when the new one has no such part); pieces that said something else, and the other substructures, stay.
public
setName(PersonalName $name) : self
Parameters
- $name : PersonalName
Return values
selfsetSex()
public
setSex(Sex $sex) : self
Parameters
- $sex : Sex
Tags
Return values
selfsex()
public
sex() : Sex|null
Return values
Sex|nullspouses()
public
spouses() : array<int, Individual>
Return values
array<int, Individual> —the other partners of the families of FAMS
tagIn()
The tag of the record type in a version.
public
static tagIn(Version $version) : string
Parameters
- $version : Version
Return values
stringtyped()
public
static typed(Node|null $record, Document|IndexedDocument|null $file, T> $class) : T|null
Parameters
- $record : Node|null
- $file : Document|IndexedDocument|null
- $class : T>
Tags
Return values
T|nullxref()
public
xref() : string|null
Return values
string|nulleventsOf()
protected
eventsOf(array<string, true> $tags) : array<int, Event>
Parameters
- $tags : array<string, true>
Return values
array<int, Event> —the events with these tags, in order
lookUp()
The record of a pointer, or null when there is none of that type.
protected
lookUp(string $xref, string $tag) : Node|null
Parameters
- $xref : string
- $tag : string
Return values
Node|nullpointers()
protected
pointers(string $tag) : array<int, string>
Parameters
- $tag : string
Return values
array<int, string> —the pointers of these substructures, null pointers left out
setText()
Replaces the value of the first substructure with this tag, adds one, or removes it for null.
protected
setText(string $tag, string|null $value) : static
Parameters
- $tag : string
- $value : string|null
Return values
statictext()
The value of the first substructure with this tag.
protected
text(string $tag) : string|null
Parameters
- $tag : string
Return values
string|nullversion()
protected
version() : Version