# DumpRow

> Typed dump row narrowed once from the Yii logger tuple and persisted in that form.

[API reference](/docs/api/index.md) › [Debug Core](/docs/extensions/debug-core/reference/index.md) › [Panel](/docs/extensions/debug-core/reference/panel/index.md) › [Dump](/docs/extensions/debug-core/reference/panel/dump/index.md) › DumpRow

| final readonly class | `PHPForge\Debug\Panel\Dump\DumpRow` |
| --- | --- |
| Implements | [`PHPForge\Debug\Storage\PanelRow`](/docs/extensions/debug-core/reference/storage/panelrow/index.md) |
| Source | [`src/Panel/Dump/DumpRow.php`](https://github.com/php-forge/debug-core/blob/main/src/Panel/Dump/DumpRow.php#L14) |

Typed dump row narrowed once from the Yii logger tuple and persisted in that form.

## Properties

| Property | Type | Description | Defined by |
| --- | --- | --- | --- |
| <span id="property-category"></span>`$category` readonly constructor | `string` | Log category attached to the dump call. | `DumpRow` |
| <span id="property-level"></span>`$level` readonly constructor | `int` | Logger level constant ([`LogLevel`](/docs/extensions/debug-core/reference/helper/loglevel/index.md)). | `DumpRow` |
| <span id="property-message"></span>`$message` readonly constructor | `string` | Highlighted dump payload as produced by the Dump collector `varDump()` pipeline. | `DumpRow` |
| <span id="property-time"></span>`$time` readonly constructor | `float` | Capture timestamp in milliseconds since the Unix epoch. | `DumpRow` |
| <span id="property-trace"></span>`$trace` readonly constructor | `list<array<string, mixed>>` | Backtrace frames captured at the dump call site. | `DumpRow` |

## Methods

| Method | Description | Defined by |
| --- | --- | --- |
| [`__construct()`](#method-__construct) | Creates a dump row from its captured log data. | `DumpRow` |
| [`fromArray()`](#method-fromArray) static | Narrows one persisted dump of the dump payload into a typed row. | `DumpRow` |
| [`fromLoggerTuple()`](#method-fromLoggerTuple) static | Converts one canonical logger tuple into a typed row. | `DumpRow` |
| [`jsonSerialize()`](#method-jsonSerialize) | Returns the typed row for JSON serialization. | `DumpRow` |

## Method details

### __construct() <span id="method-__construct"></span>

```php
public function __construct(string $message, int $level, string $category, float $time, array $trace)
```

Creates a dump row from its captured log data.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$message` | `string` |  |
| `$level` | `int` |  |
| `$category` | `string` |  |
| `$time` | `float` |  |
| `$trace` | `array` |  |

### fromArray() <span id="method-fromArray"></span>

```php
public static function fromArray(mixed $data, string $path): self
```

Narrows one persisted dump of the dump payload into a typed row.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$data` | `mixed` | Persisted dump, expected to be an object carrying the declared shape. |
| `$path` | `string` | JSON path of the dump, used to report a malformed payload. |

**Returns**

`self`: Row carrying every persisted dump field.

### fromLoggerTuple() <span id="method-fromLoggerTuple"></span>

```php
public static function fromLoggerTuple(PHPForge\Debug\Panel\Dump\LogTuple $message): self
```

Converts one canonical logger tuple into a typed row.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$message` | `PHPForge\Debug\Panel\Dump\LogTuple` | Logger tuple `[message, level, category, timestamp, traces]`. |

**Returns**

`self`

### jsonSerialize() <span id="method-jsonSerialize"></span>

```php
public function jsonSerialize(): array<string, mixed>
```

Returns the typed row for JSON serialization.

**Returns**

`array<string, mixed>`