> For the complete documentation index, see [llms.txt](https://pckg.gitbook.io/documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://pckg.gitbook.io/documentation/core-packages/index-4/record/fields.md).

# Fields

By default, data gets stored as a scalar value in the `array $data` field of the `Record`.

You can wrap the scalar value in the `Record` by defining the `private $mapper` field on the record.

```php
<?php

namespace Vendor\Domain\Record;

use Pckg\Database\Field\Datetime;

/**
 * @property Datetime $registered_at
 */
class User
{
    // ...
    protected $mapper = [
        'registered_at' => Datetime::class,
    ];
}
```

Or you can achieve the same thing by defining a property.

```php
<?php

namespace Vendor\Domain\Record;

use Pckg\Database\Field\Datetime;

class User
{
    // ...
    protected ?Datetime $registered_at;
}
```

## Datetime

## JSON

### Array

### Object

## Point

## Raw
