PHPackages                             sapphire/mapper - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. sapphire/mapper

ActiveLibrary[Database &amp; ORM](/categories/database)

sapphire/mapper
===============

Mapper library written in PHP for AWS DynamoDB

10PHPCI failing

Since Jun 22Pushed 11mo agoCompare

[ Source](https://github.com/sapphire-odm/mapper)[ Packagist](https://packagist.org/packages/sapphire/mapper)[ RSS](/packages/sapphire-mapper/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Sapphire-ODM Mapper
===================

[](#sapphire-odm-mapper)

[![sapphire logo](./sapphire-logo-horizontal.png "Logo")](./sapphire-logo-horizontal.png)

PHP Class Mapper for AWS DynamoDB
---------------------------------

[](#php-class-mapper-for-aws-dynamodb)

This library converts your PHP class with the help of PHP attributes to the array structure needed to work with AWS DynamoDB.

Example
-------

[](#example)

**Your class:**

```
#[DynamoObject(tableName: "products")]
class Product
{
    #[DynamoField(type: DynamoType::STRING)]
    private string $id;

    #[DynamoField(type: DynamoType::STRING)]
    public string $name;

    #[DynamoField(type: DynamoType::NUMBER)]
    public float $price;

    #[DynamoField(type: DynamoType::LIST)]
    public array $tags = [];

    public function __construct()
    {
        $this->id = uniqid();
    }

    public function getId(): string
    {
        return $this->id;
    }
}
```

**Usage of the mapper:**

```
$product = new Product();
$product->name = "Dominator 2025";
$product->price = 13.37;
$product->tags = ["top seller", "hot", 2025];

$mapper = new DynamoMapper();

$item = $mapper->toPutItem($product);
```

**Result:**

```
// The $item looks like this:
array:2 [
  "TableName" => "products"
  "Item" => array:4 [
    "id" => array:1 [
      "S" => "6857e3326fdc2"
    ]
    "name" => array:1 [
      "S" => "Dominator 2025"
    ]
    "price" => array:1 [
      "N" => "13.37"
    ]
    "tags" => array:1 [
      "L" => array:3 [
        0 => array:1 [
          "S" => "top seller"
        ]
        1 => array:1 [
          "S" => "hot"
        ]
        2 => array:1 [
          "N" => "2025"
        ]
      ]
    ]
  ]
]
```

Installation
------------

[](#installation)

`composer req `

Run tests
---------

[](#run-tests)

**Unit tests:**

`composer test:unit`

**Feature/Integration tests:**

`composer test:feature`

###  Health Score

15

—

LowBetter than 3% of packages

Maintenance38

Infrequent updates — may be unmaintained

Popularity2

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity14

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/7d5ceb20b0dbb97f2efa3a6e54eaebf27baba1fa06c8ec9ee18e6c56ee1752f7?d=identicon)[thedomeffm](/maintainers/thedomeffm)

---

Top Contributors

[![thedomeffm](https://avatars.githubusercontent.com/u/29406401?v=4)](https://github.com/thedomeffm "thedomeffm (9 commits)")

### Embed Badge

![Health badge](/badges/sapphire-mapper/health.svg)

```
[![Health](https://phpackages.com/badges/sapphire-mapper/health.svg)](https://phpackages.com/packages/sapphire-mapper)
```

###  Alternatives

[doctrine/orm

Object-Relational-Mapper for PHP

10.2k285.3M6.2k](/packages/doctrine-orm)[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k115.1M102](/packages/jdorn-sql-formatter)[illuminate/database

The Illuminate Database package.

2.8k52.4M9.4k](/packages/illuminate-database)[ramsey/uuid-doctrine

Use ramsey/uuid as a Doctrine field type.

90440.3M211](/packages/ramsey-uuid-doctrine)[reliese/laravel

Reliese Components for Laravel Framework code generation.

1.7k3.4M16](/packages/reliese-laravel)[wildside/userstamps

Laravel Userstamps provides an Eloquent trait which automatically maintains `created\_by` and `updated\_by` columns on your model, populated by the currently authenticated user in your application.

7511.7M13](/packages/wildside-userstamps)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
