Skip to content

API reference / Quittio \ Core \ Data

Identifier

final readonly class in quittio/core · uses Immutable

Quittio\Core\Data\Identifier · Source

Identifier with an optional scheme (ISO/IEC 6523 ICD or another code list depending on the field).

Properties#

PropertyTypeDescription
$scheme readonlyIdentifierScheme|RawCode|null
$value readonlystring

Methods#

MethodDescription
->__construct()
::of()An identifier with the scheme as enum case; a scheme string without enum case becomes a RawCode.
->schemeValue()The scheme as plain string, also for a RawCode; null without scheme.
->with()Returns a copy with the given properties replaced.

__construct()#

public function __construct(string $value, IdentifierScheme|RawCode|null $scheme = null)
ParameterTypeDescription
$valuestring
$schemeIdentifierScheme|RawCode|null = null

of()#

public static function of(
    string $value,
    IdentifierScheme|RawCode|string|null $scheme = null,
): self

static

An identifier with the scheme as enum case; a scheme string without enum case becomes a RawCode.

ParameterTypeDescription
$valuestring
$schemeIdentifierScheme|RawCode|string|null = null
Returns
self

schemeValue()#

public function schemeValue(): ?string

The scheme as plain string, also for a RawCode; null without scheme.

Returns
?string

with()#

public function with(array<string, mixed> $changes): static

Returns a copy with the given properties replaced.

ParameterTypeDescription
$changesarray<string, mixed>
Returns
static

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