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#
| Method | Description |
|---|---|
::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,
): ?stringBusiness 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).
| Parameter | Type | Description |
|---|---|---|
$class | class-string | |
$property | string | |
$parentTerm | string|null | business 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>| Parameter | Type | Description |
|---|---|---|
$class | class-string |
- Returns
array<string, FieldDefinition>
level()#
public static function level(
class-string $class,
string $property,
ProfileLevel|null $parentLevel = null,
): ProfileLevelLowest 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.
| Parameter | Type | Description |
|---|---|---|
$class | class-string | |
$property | string | |
$parentLevel | ProfileLevel|null = null | effective level of the parent field, null at the top level |
- Returns
ProfileLevel