# UserAttribute

> Typed view-model for one user-identity attribute row.

[API reference](/docs/api/index.md) › [Debug Core](/docs/extensions/debug-core/reference/index.md) › [Panel](/docs/extensions/debug-core/reference/panel/index.md) › [User](/docs/extensions/debug-core/reference/panel/user/index.md) › UserAttribute

| final readonly class | `PHPForge\Debug\Panel\User\UserAttribute` |
| --- | --- |
| Source | [`src/Panel/User/UserAttribute.php`](https://github.com/php-forge/debug-core/blob/main/src/Panel/User/UserAttribute.php#L10) |

Typed view-model for one user-identity attribute row.

## Properties

| Property | Type | Description | Defined by |
| --- | --- | --- | --- |
| <span id="property-displayValue"></span>`$displayValue` readonly constructor | `string` | Display string with surrounding [`Dump`](/docs/extensions/debug-core/reference/helper/dump/index.md) quotes already stripped, or `''` when the raw value was `null` or empty. | `UserAttribute` |
| <span id="property-key"></span>`$key` readonly constructor | `string` | Raw attribute key (for example, `username`, `created_at`, `auth_key`). | `UserAttribute` |
| <span id="property-kind"></span>`$kind` readonly constructor | `string` | Rendering kind; one of the `KIND_*` constants. | `UserAttribute` |
| <span id="property-label"></span>`$label` readonly constructor | `string` | Human-readable label resolved through the [`Model::attributeLabels()`](/docs/api/yii/base/model/index.md#method-attributeLabels) map, or computed as a title-cased version of `$key`. | `UserAttribute` |
| <span id="property-timestampAbs"></span>`$timestampAbs` readonly constructor | `string` | Absolute timestamp string (for example, `Apr 13, 2026 · 14:19`); only populated when `$kind === KIND_TIMESTAMP`. Default: `''`. | `UserAttribute` |
| <span id="property-timestampRel"></span>`$timestampRel` readonly constructor | `string` | Relative timestamp string (for example, `28 d ago`); only populated when `$kind === KIND_TIMESTAMP`. Default: `''`. | `UserAttribute` |

## Methods

| Method | Description | Defined by |
| --- | --- | --- |
| [`__construct()`](#method-__construct) | Creates a user-identity attribute row. | `UserAttribute` |

## Constants

| Constant | Value | Description | Defined by |
| --- | --- | --- | --- |
| <span id="const-KIND_EMPTY"></span>`KIND_EMPTY` | `'empty'` | Rendering kind: empty `—` placeholder. | `UserAttribute` |
| <span id="const-KIND_PLAIN"></span>`KIND_PLAIN` | `'plain'` | Rendering kind: plain text value. | `UserAttribute` |
| <span id="const-KIND_SECURITY"></span>`KIND_SECURITY` | `'security'` | Rendering kind: masked value behind a reveal button. | `UserAttribute` |
| <span id="const-KIND_TIMESTAMP"></span>`KIND_TIMESTAMP` | `'timestamp'` | Rendering kind: timestamp pair (relative + absolute). | `UserAttribute` |

## Method details

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

```php
public function __construct(string $key, string $label, string $displayValue, string $kind, string $timestampRel = '', string $timestampAbs = '')
```

Creates a user-identity attribute row.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$key` | `string` |  |
| `$label` | `string` |  |
| `$displayValue` | `string` |  |
| `$kind` | `string` |  |
| `$timestampRel` | `string` |  |
| `$timestampAbs` | `string` |  |