Family
extends RecordView
in package
A live view of a FAM record: partners, children and events. Linking an individual also adds the pointer back (FAMS, FAMC), so the links stay mutual.
Table of Contents
Constants
- EVENTS : array<string, true> = ['ANUL' => true, 'CENS' => true, 'DIV' => true,...
- TAG : string = 'FAM'
Properties
- $file : Document|IndexedDocument|null
- $node : Node
Methods
- __construct() : mixed
- addChild() : self
- Adds CHIL and the child's FAMC, unless they are there.
- 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.
- addMarriage() : Event
- children() : array<int, Individual>
- events() : array<int, Event>
- husband() : Individual|null
- marriage() : Event|null
- memberXrefs() : array<int, string>
- node() : Node
- of() : self|null
- partners() : array<int, Individual>
- removeChild() : self
- Removes CHIL and the child's FAMC to this family.
- setHusband() : self
- Points HUSB to the individual and adds its FAMS.
- setWife() : self
- Points WIFE to the individual and adds its FAMS.
- tagIn() : string
- The tag of the record type in a version.
- typed() : T|null
- wife() : Individual|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
= ['ANUL' => true, 'CENS' => true, 'DIV' => true, 'DIVF' => true, 'ENGA' => true, 'MARB' => true, 'MARC' => true, 'MARR' => true, 'MARL' => true, 'MARS' => true, 'EVEN' => true]
family events of 5.5, 5.5.1, 5.5.5 and 7.0
TAG
public
string
TAG
= 'FAM'
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
addChild()
Adds CHIL and the child's FAMC, unless they are there.
public
addChild(Individual $child) : self
Parameters
- $child : Individual
Return values
selfaddEvent()
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
EventaddMarriage()
public
addMarriage([GedcomDate|null $date = null ][, Place|null $place = null ]) : Event
Parameters
- $date : GedcomDate|null = null
- $place : Place|null = null
Return values
Eventchildren()
public
children() : array<int, Individual>
Return values
array<int, Individual>events()
public
events(string ...$tags) : array<int, Event>
Parameters
- $tags : string
Return values
array<int, Event> —the events, or those with these tags, in order
husband()
public
husband() : Individual|null
Return values
Individual|nullmarriage()
public
marriage() : Event|null
Return values
Event|nullmemberXrefs()
public
memberXrefs() : array<int, string>
Return values
array<int, string> —HUSB, WIFE and CHIL pointers; no other record is read
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|nullpartners()
public
partners() : array<int, Individual>
Return values
array<int, Individual> —HUSB and WIFE, in order
removeChild()
Removes CHIL and the child's FAMC to this family.
public
removeChild(Individual $child) : self
Parameters
- $child : Individual
Return values
selfsetHusband()
Points HUSB to the individual and adds its FAMS.
public
setHusband(Individual $husband) : self
Parameters
- $husband : Individual
Return values
selfsetWife()
Points WIFE to the individual and adds its FAMS.
public
setWife(Individual $wife) : self
Parameters
- $wife : Individual
Return values
selftagIn()
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|nullwife()
public
wife() : Individual|null
Return values
Individual|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