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#
| Property | Type | Description |
|---|---|---|
$scheme readonly | IdentifierScheme|RawCode|null | |
$value readonly | string |
Methods#
| Method | Description |
|---|---|
->__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)| Parameter | Type | Description |
|---|---|---|
$value | string | |
$scheme | IdentifierScheme|RawCode|null = null |
of()#
public static function of(
string $value,
IdentifierScheme|RawCode|string|null $scheme = null,
): selfAn identifier with the scheme as enum case; a scheme string without enum case becomes a RawCode.
| Parameter | Type | Description |
|---|---|---|
$value | string | |
$scheme | IdentifierScheme|RawCode|string|null = null |
- Returns
self
schemeValue()#
public function schemeValue(): ?stringThe scheme as plain string, also for a RawCode; null without scheme.
- Returns
?string
with()#
public function with(array<string, mixed> $changes): staticReturns a copy with the given properties replaced.
| Parameter | Type | Description |
|---|---|---|
$changes | array<string, mixed> |
- Returns
static