PHPackages                             api-skeletons/doctrine-repository - 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. api-skeletons/doctrine-repository

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

api-skeletons/doctrine-repository
=================================

Plugin Architecture for Doctrine Repositories

2.0.1(5y ago)1114MITPHPPHP ^7.3

Since Mar 31Pushed 5y ago2 watchersCompare

[ Source](https://github.com/API-Skeletons/doctrine-repository)[ Packagist](https://packagist.org/packages/api-skeletons/doctrine-repository)[ RSS](/packages/api-skeletons-doctrine-repository/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (7)Versions (3)Used By (0)

doctrine-repository
===================

[](#doctrine-repository)

[![Build Status](https://camo.githubusercontent.com/5fb996c98a95858c7735ce6983b13fea8d39140650cc4a4446a7a884f4bd127d/68747470733a2f2f7472617669732d63692e6f72672f4150492d536b656c65746f6e732f646f637472696e652d7265706f7369746f72792e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/API-Skeletons/doctrine-repository)[![Gitter](https://camo.githubusercontent.com/c45f0485e89d3cd41f666d7d4bb5875cb59836555e05b6b11f77ed223eb64c0c/68747470733a2f2f6261646765732e6769747465722e696d2f6170692d736b656c65746f6e732f6f70656e2d736f757263652e737667)](https://gitter.im/api-skeletons/open-source)[![Total Downloads](https://camo.githubusercontent.com/6457d3c87519e46178e532f15640705043ba1d33145a9a7093102181b2493dfd/68747470733a2f2f706f7365722e707567782e6f72672f6170692d736b656c65746f6e732f646f637472696e652d7265706f7369746f72792f646f776e6c6f616473)](https://packagist.org/packages/api-skeletons/doctrine-repository)

This is a replacement for the default repository structure of Doctrine ORM. This replacement implements a plugin architecture for extensisons to repositories.

For instance, if you need access to an encryption/decryption resource inside your repository you could implement it as a plugin accessible as

```
$this->plugin('encryption')->encrypt($value);
```

Why use this repository structure?
----------------------------------

[](#why-use-this-repository-structure)

The default repository for Doctrine ORM gives no access to resources outside Doctrine. And the Doctrine ORM Object Manager does not give access to a dependency injection container. So when your applications require more from their repositories the only option is to write your own dependency injection enabled repository factory. To create a standard way to organize this dependency injection repository factory: this is an acceptable solution.

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

[](#installation)

Installation of this module uses composer. For composer documentation, please refer to [getcomposer.org](http://getcomposer.org/).

```
$ composer require api-skeletons/doctrine-repository
```

Once installed, add `ZF\Doctrine\Repository` to your list of modules inside `config/application.config.php` or `config/modules.config.php`.

> ### laminas-component-installer
>
> [](#laminas-component-installer)
>
> If you use [laminas-component-installer](https://github.com/laminas/laminas-component-installer), that plugin will install doctrine-repository as a module for you.

Configuration
-------------

[](#configuration)

No manual configuration is required to use this module.

This module makes these changes to your `doctrine.entitymanager.orm_default` configuration:

```
namespace ZF\Doctrine\Repository;
...
    'doctrine' => [
        'configuration' => [
            'orm_default' => [
                'repository_factory' => RepositoryFactory::class,
                'default_repository_class_name' => ObjectRepository::class,
            ],
        ],
    ],

```

If your application already has a default repository class you can edit it to implement `ZF\Doctrine\Repository\ObjectRepositoryInterface` and the RepositoryFactory can use it.

Creating a Plugin
-----------------

[](#creating-a-plugin)

The config key for the repository plugin service locator is `api-skeletons-doctrine-repository-plugin`. Your plugin must implement `ZF\Doctrine\Repository\Plugin\PluginInterface`

The `__construct` of your Plugin will take an array including the repository and any other parameters. Access to the repository gives you access to the ObjectManager.

Use the [testing boolean plugin](https://github.com/API-Skeletons/doctrine-repository/blob/master/test/asset/module/Doctrine/src/Plugin/BooleanPlugin.php)and [testing boolean plugin configuration](https://github.com/API-Skeletons/doctrine-repository/blob/master/test/asset/module/Doctrine/config/module.config.php)as a template.

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 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 ~0 days

Total

2

Last Release

1866d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/49dd7d9dba889ac674b0da447d9c1e69d1128dc3ccbaef98ba83d6ee519fc2d6?d=identicon)[tom\_anderson](/maintainers/tom_anderson)

---

Top Contributors

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

###  Code Quality

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/api-skeletons-doctrine-repository/health.svg)

```
[![Health](https://phpackages.com/badges/api-skeletons-doctrine-repository/health.svg)](https://phpackages.com/packages/api-skeletons-doctrine-repository)
```

###  Alternatives

[doctrine/doctrine-orm-module

Laminas Module that provides Doctrine ORM functionality

4407.3M293](/packages/doctrine-doctrine-orm-module)

PHPackages © 2026

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