PHPackages                             stefanotorresi/thorr-persistence - 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. stefanotorresi/thorr-persistence

ActiveLibrary

stefanotorresi/thorr-persistence
================================

Agnostic interfaces for a DataMapper implementation through vendor specific adapters

1.0.0(10y ago)25463MITPHPPHP ~5.5

Since Mar 3Pushed 9y ago1 watchersCompare

[ Source](https://github.com/stefanotorresi/thorr-persistence)[ Packagist](https://packagist.org/packages/stefanotorresi/thorr-persistence)[ RSS](/packages/stefanotorresi-thorr-persistence/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (7)Versions (5)Used By (3)

Thorr\\Persistence
==================

[](#thorrpersistence)

[![Latest Stable Version](https://camo.githubusercontent.com/93f3ad83d1c777743accba6248725bbcf3c18d4169768ac9347af3e70c9b88c0/68747470733a2f2f706f7365722e707567782e6f72672f73746566616e6f746f72726573692f74686f72722d70657273697374656e63652f762f737461626c652e706e67)](https://packagist.org/packages/stefanotorresi/thorr-persistence)[![Latest Unstable Version](https://camo.githubusercontent.com/99224a22adb0cc2096f6ddbd459eb330a792e9c0d6cff54d0f0c9df5968bbd57/68747470733a2f2f706f7365722e707567782e6f72672f73746566616e6f746f72726573692f74686f72722d70657273697374656e63652f762f756e737461626c652e706e67)](https://packagist.org/packages/stefanotorresi/thorr-persistence)[![Build Status](https://camo.githubusercontent.com/e022e7fa336ad591e95d731eec63b99678fd6f8427cfaba21fdb8ce0ee261f36/68747470733a2f2f7472617669732d63692e6f72672f73746566616e6f746f72726573692f74686f72722d70657273697374656e63652e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/stefanotorresi/thorr-persistence)[![Code Coverage](https://camo.githubusercontent.com/565a263035f9d7a881beaa56d3c7c207c0187ef39310398c2cc083c2591c1e91/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f73746566616e6f746f72726573692f74686f72722d70657273697374656e63652f6261646765732f636f7665726167652e706e673f733d33333337313964363233653539343138396439393736373263613463313835326366363635613637)](https://scrutinizer-ci.com/g/stefanotorresi/thorr-persistence/)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/2f337f2e32f07430ff1bfac3987921cf3e86c2b0bd18969e28b79c10453d2711/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f73746566616e6f746f72726573692f74686f72722d70657273697374656e63652f6261646765732f7175616c6974792d73636f72652e706e673f733d31613335306539656538366462376239656332643030363637353430353239323132336632306362)](https://scrutinizer-ci.com/g/stefanotorresi/thorr-persistence/)

Agnostic interfaces for a DataMapper implementation through vendor specific adapters.

Implementations
---------------

[](#implementations)

- [Thorr\\Persistence\\Doctrine](http://github.com/stefanotorresi/thorr-persistence-doctrine) for [Doctrine ORM](http://www.doctrine-project.org)

DataMapperManager usage
-----------------------

[](#datamappermanager-usage)

This library provides an optional Zend Framework 2 plugin manager for `DataMapperInterface` instances, the `DataMapperManager`.

It provides a method to retrieve data mappers for your entities: `DataMapperManager::getDataMapperForEntity($entity)`.

Here is an example:

```
$config = new DataMapperManagerConfig([
    'entity_data_mapper_map' => [
        Entity::class => 'EntityDataMapperServiceName',
    ],
    'factories' => [
        'EntityDataMapperServiceName' => function () {
            // return a DataMapperInterface
        },
    ],
]);

$dataMapperManager = new DataMapperManager($config);

// retrieves the service configured as 'EntityDataMapperServiceName'
$entityMapper = $dataMapperManager->getDataMapperForEntity(Entity::class);
```

To use the `DataMapperManager` you have to require `zendframework/zend-servicemanager` via Composer:

```
composer require zendframework/zend-servicemanager
```

### Usage in a ZF2 module

[](#usage-in-a-zf2-module)

When using the library as a Zend Framework 2 module, you can load the module `Thorr\Persistence` and implement `DataMapperManagerConfigProviderInterface` in your modules to provide the configuration via the `getDataMapperManagerConfig()` method.

The module will also register in the main `ServiceManager` a `DataMapperManager` instance with its FQCN, aliased with the `DataMapperManager` name, so you can retrieve it as follows:

```
$serviceManager->get(DataMapperManager::class);
// or
$serviceManager->get('DataMapperManager');
```

###  Health Score

30

—

LowBetter than 65% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity61

Established project with proven stability

 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.

###  Release Activity

Cadence

Every ~38 days

Total

3

Last Release

4009d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/dbe15d47dd8509ff2f5b24bb02e4d271689242ab2e5608d0f67259e277491a9a?d=identicon)[stefanotorresi](/maintainers/stefanotorresi)

---

Top Contributors

[![stefanotorresi](https://avatars.githubusercontent.com/u/2952427?v=4)](https://github.com/stefanotorresi "stefanotorresi (43 commits)")

### Embed Badge

![Health badge](/badges/stefanotorresi-thorr-persistence/health.svg)

```
[![Health](https://phpackages.com/badges/stefanotorresi-thorr-persistence/health.svg)](https://phpackages.com/packages/stefanotorresi-thorr-persistence)
```

###  Alternatives

[zircote/rhubarb

A PHP Celery Client Implementation

1381.4k](/packages/zircote-rhubarb)[gointegro/hateoas

GOintegro HATEOAS Lib

408.0k1](/packages/gointegro-hateoas)

PHPackages © 2026

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