Skip to content

API reference / Quittio \ Core \ Mapping

FieldMatrix

final class in quittio/core

Quittio\Core\Mapping\FieldMatrix · Source

Field metadata of all DTOs, derived from the mapping attributes (single source for profile validation, documentation and coverage reports).

Methods#

MethodDescription
::businessTerm()Business term of a field, resolved for shared structures (Address, Contact, Period) from the business term of the parent field, e.g. BT-55 for the country code of the buyer address (BG-8).
::fields()
::level()Lowest profile level that carries a field where it is used: its own level (EN 16931 without a Level attribute, EXTENDED for fields of EXTENDED only), raised to the level of the parent field, because a part is written only together with its parent. E.g. the address parts of BASIC WL inside the seller address (BG-5, MINIMUM) stay BASIC WL, the country code (BT-40, MINIMUM) stays MINIMUM; inside the buyer address (BG-8, BASIC WL) the country code (BT-55) is BASIC WL.

businessTerm()#

public static function businessTerm(
    class-string $class,
    string $property,
    string|null $parentTerm,
): ?string

static

Business term of a field, resolved for shared structures (Address, Contact, Period) from the business term of the parent field, e.g. BT-55 for the country code of the buyer address (BG-8).

ParameterTypeDescription
$classclass-string
$propertystring
$parentTermstring|nullbusiness term of the parent field (e.g. BG-8), null at the top level
Returns
?string

fields()#

public static function fields(class-string $class): array<string, FieldDefinition>

static

ParameterTypeDescription
$classclass-string
Returns
array<string, FieldDefinition>

level()#

public static function level(
    class-string $class,
    string $property,
    ProfileLevel|null $parentLevel = null,
): ProfileLevel

static

Lowest profile level that carries a field where it is used: its own level (EN 16931 without a Level attribute, EXTENDED for fields of EXTENDED only), raised to the level of the parent field, because a part is written only together with its parent. E.g. the address parts of BASIC WL inside the seller address (BG-5, MINIMUM) stay BASIC WL, the country code (BT-40, MINIMUM) stays MINIMUM; inside the buyer address (BG-8, BASIC WL) the country code (BT-55) is BASIC WL.

ParameterTypeDescription
$classclass-string
$propertystring
$parentLevelProfileLevel|null = nulleffective level of the parent field, null at the top level
Returns
ProfileLevel

The open core packages are MIT licensed. The legal wording of the country packs must be confirmed by a tax adviser.