Korin API

Profile
in package

FinalYes

The rules of one GEDCOM version as data: which structures exist, where they may appear and how often, their payload types, enumerations and calendars. Compiled from spec/ into resources/profiles by bin/generate-profiles.php.

Tags
phpstan-type

ProfileData array{ version: string, source: string, root: array<string, array{string, int, int}>, structures: array<string, array{tag: string, payload: ?string, enumset: ?string, children: array<string, array{string, int, int}>, forms?: array{pointer: array<string, array{string, int, int}>, inline: array<string, array{string, int, int}>}}>, enumsets: array<string, list>, types: array<string, string>, sizes: array<string, array{int, int}>, listed?: array<string, list>, calendars: array<string, array{uri: string, months: list, epochs: list}>, months?: array<string, string>, deprecated?: array{structures: array<string, string>, values: array<string, array<string, string>>, without: array<string, string>}, choices?: array<string, list<list>> }

Table of Contents

Methods

calendars()  : array<string, array{uri: string, months: list, epochs: list}>
choices()  : array<int, array<int, string>>
7.0: groups of substructures of which a structure allows one (spec/7.0/choices.yaml: HEAD has a NOTE or an SNOTE).
deprecatedValue()  : string|null
7.0: as deprecation(), for a value of an enumeration set.
deprecatedWithout()  : string|null
7.0: the tag of the substructure without which a structure is deprecated (EXID without TYPE).
deprecation()  : string|null
7.0: what to write instead of a deprecated structure (spec/7.0/deprecations.yaml); '' when the specification names nothing, null when the structure is not deprecated.
enumeration()  : array<int, string>
for()  : self
has()  : bool
listed()  : array<int, string>
Values the specification lists for a 5.5.5 text element with a size, valid whatever their length: the printed size contradicts them ("<NAME_TYPE>" aka, {Size=5:30}).
months()  : array<string, string>
record()  : Substructure|null
A top-level structure (record, HEAD or TRLR) by tag.
records()  : array<string, Substructure>
resolve()  : Structure|null
The structure reached by a path of tags from the top level, e.g. ['INDI', 'BIRT', 'DATE']; null when some tag is not allowed there (an extension tag, or an error).
size()  : array{int, int}|null
The minimum and maximum length of a 5.5.5 text element such as "<ADDRESS_CITY>", in characters; null when the version gives none (sizes are recommendations before 5.5.5).
source()  : string
Where the profile was compiled from, e.g. "FamilySearch GEDCOM v7.0.18 (…)".
structure()  : Structure|null
type()  : string|null
The kind of a 5.x primitive element such as "<SEX_VALUE>": "ENUM" (values from enumeration()) or the name of a grammar such as "DATE_VALUE"; null for text and in 7.0.
version()  : Version

Methods

calendars()

public calendars() : array<string, array{uri: string, months: list, epochs: list}>
Return values
array<string, array{uri: string, months: list, epochs: list}> —

by calendar tag

choices()

7.0: groups of substructures of which a structure allows one (spec/7.0/choices.yaml: HEAD has a NOTE or an SNOTE).

public choices(string $uri) : array<int, array<int, string>>
Parameters
$uri : string
Return values
array<int, array<int, string>>

deprecatedValue()

7.0: as deprecation(), for a value of an enumeration set.

public deprecatedValue(string $enumerationSet, string $value) : string|null
Parameters
$enumerationSet : string
$value : string
Return values
string|null

deprecatedWithout()

7.0: the tag of the substructure without which a structure is deprecated (EXID without TYPE).

public deprecatedWithout(string $uri) : string|null
Parameters
$uri : string
Return values
string|null

deprecation()

7.0: what to write instead of a deprecated structure (spec/7.0/deprecations.yaml); '' when the specification names nothing, null when the structure is not deprecated.

public deprecation(string $uri) : string|null
Parameters
$uri : string
Return values
string|null

enumeration()

public enumeration(string $uri) : array<int, string>
Parameters
$uri : string
Return values
array<int, string> —

values of an enumeration set (7.0 URI) or of a 5.x element ("<SEX_VALUE>")

for()

public static for(Version $version) : self
Parameters
$version : Version
Tags
throws
InvalidArgumentException

when there is no profile for the version yet

Return values
self

listed()

Values the specification lists for a 5.5.5 text element with a size, valid whatever their length: the printed size contradicts them ("<NAME_TYPE>" aka, {Size=5:30}).

public listed(string $element) : array<int, string>
Parameters
$element : string
Return values
array<int, string>

months()

public months() : array<string, string>
Return values
array<string, string> —

7.0: month URI => tag, of every calendar

record()

A top-level structure (record, HEAD or TRLR) by tag.

public record(string $tag) : Substructure|null
Parameters
$tag : string
Return values
Substructure|null

resolve()

The structure reached by a path of tags from the top level, e.g. ['INDI', 'BIRT', 'DATE']; null when some tag is not allowed there (an extension tag, or an error).

public resolve(array<int, string> $tags) : Structure|null
Parameters
$tags : array<int, string>
Return values
Structure|null

size()

The minimum and maximum length of a 5.5.5 text element such as "<ADDRESS_CITY>", in characters; null when the version gives none (sizes are recommendations before 5.5.5).

public size(string $element) : array{int, int}|null
Parameters
$element : string
Return values
array{int, int}|null

source()

Where the profile was compiled from, e.g. "FamilySearch GEDCOM v7.0.18 (…)".

public source() : string
Return values
string

type()

The kind of a 5.x primitive element such as "<SEX_VALUE>": "ENUM" (values from enumeration()) or the name of a grammar such as "DATE_VALUE"; null for text and in 7.0.

public type(string $element) : string|null
Parameters
$element : string
Return values
string|null
On this page

Search results