DXNObjectId
in package
implements
DXNValueInterface
DXN `objectid` (`@objectid "..."`, Jan, 2026-10-20): BSON's 12-byte ObjectId, built in like `uuid` -- readable in text, its raw bytes in `.dxnb` (tag 221). The value holds the bytes; the 24 hex digits exist only at the text boundary.
Table of Contents
Interfaces
- DXNValueInterface
- Implemented by every `DXN*` wrapper class -- the PHP analog of the `dxnType` string tag used for kind dispatch in the JS port, and of `Dextrin.Value`'s closed type union in the Elixir original. Native PHP values (`null`, `bool`, `int`, `float`, `string`, and `array` for `map`/`array`) never implement this; {@see Equality::kindOf()} handles those directly.
Constants
- DXN_TYPE : mixed = 'objectid'
Properties
- $bytes : string
- Exactly 12 raw bytes.
Methods
- __construct() : mixed
- __toString() : string
- compareTo() : int
- A total order against any other DXN value, not just another instance of this class -- backs {@see DXNSortedSet}. Cross-kind ordering is implementation-defined per DXN.md; within a kind, uses the kind's own natural order where one exists, or a deterministic structural fallback where it doesn't.
- dxnType() : string
- The DXN type name this value represents, e.g. "symbol", "uuid".
- equals() : bool
- Structural equality, recursing into nested DXN values as needed.
- fromString() : self
- 24 hex digits, either case; {@see self::toString()} always lowercases.
- toString() : string
- The 24 lowercase hex digits, e.g. `507f1f77bcf86cd799439011`.
Constants
DXN_TYPE
private
mixed
DXN_TYPE
= 'objectid'
Properties
$bytes read-only
Exactly 12 raw bytes.
public
string
$bytes
Methods
__construct()
public
__construct(string $bytes) : mixed
Parameters
- $bytes : string
__toString()
public
__toString() : string
Return values
stringcompareTo()
A total order against any other DXN value, not just another instance of this class -- backs {@see DXNSortedSet}. Cross-kind ordering is implementation-defined per DXN.md; within a kind, uses the kind's own natural order where one exists, or a deterministic structural fallback where it doesn't.
public
compareTo(mixed $other) : int
Parameters
- $other : mixed
Return values
intdxnType()
The DXN type name this value represents, e.g. "symbol", "uuid".
public
dxnType() : string
Return values
stringequals()
Structural equality, recursing into nested DXN values as needed.
public
equals(mixed $other) : bool
Parameters
- $other : mixed
Return values
boolfromString()
24 hex digits, either case; {@see self::toString()} always lowercases.
public
static fromString(string $s) : self
Parameters
- $s : string
Return values
selftoString()
The 24 lowercase hex digits, e.g. `507f1f77bcf86cd799439011`.
public
toString() : string