DbSnapshot
API reference › Debug Core › Panel › Db › DbSnapshot
Canonical database panel snapshot holding the resolved query rows in their typed form.
Methods
Section titled “Methods”| Method | Description | Defined by |
|---|---|---|
__construct() | Creates a database snapshot from captured query rows. | DbSnapshot |
capture() static | Resolves exact SQL duplicates while preserving capture order and the persisted row contract. | DbSnapshot |
entries() | Returns the captured query rows. | DbSnapshot |
fromArray() static | Narrows the persisted database payload into a typed snapshot. | DbSnapshot |
jsonSerialize() | Returns the panel snapshot for JSON serialization. | DbSnapshot |
Method details
Section titled “Method details”__construct()
Section titled “__construct() ”public function __construct(list<PHPForge\Debug\Panel\Db\QueryRow> $entries)Creates a database snapshot from captured query rows.
Parameters
| Parameter | Type | Description |
|---|---|---|
$entries | list<QueryRow> |
capture()
Section titled “capture() ”public static function capture(list<PHPForge\Debug\Panel\Db\QueryRow> $rows): selfResolves exact SQL duplicates while preserving capture order and the persisted row contract.
entries()
Section titled “entries() ”public function entries(): list<PHPForge\Debug\Panel\Db\QueryRow>Returns the captured query rows.
Returns
list<QueryRow>: Executed statements in capture order.
fromArray()
Section titled “fromArray() ”public static function fromArray(mixed $data, string $path): selfNarrows the persisted database payload into a typed snapshot.
Parameters
| Parameter | Type | Description |
|---|---|---|
$data | mixed | Persisted payload, expected to be an object carrying an entries list. |
$path | string | JSON path of the payload, used to report a malformed capture. |
Returns
self: Snapshot carrying the persisted query rows.
jsonSerialize()
Section titled “jsonSerialize() ”public function jsonSerialize(): array<string, mixed>Returns the panel snapshot for JSON serialization.
Returns
array<string, mixed>