PHPackages                             wms/doctrine-extended-repository-bundle - 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. wms/doctrine-extended-repository-bundle

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

wms/doctrine-extended-repository-bundle
=======================================

Allows the use of DI within Doctrine Repositories

01.1kPHP

Since May 8Pushed 12y ago1 watchersCompare

[ Source](https://github.com/WolfMicrosystems/doctrine-extended-repositories-bundle)[ Packagist](https://packagist.org/packages/wms/doctrine-extended-repository-bundle)[ RSS](/packages/wms-doctrine-extended-repository-bundle/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (1)Used By (0)

WMSDoctrineExtendedRepositoriesBundle
=====================================

[](#wmsdoctrineextendedrepositoriesbundle)

The WMSDoctrineExtendedRepositoriesBundle allows you to use dependency injection within Doctrine Repositories by registering them as services.

This document contains information on how to download, install and use this bundle.

1. Installing the Bundle

---

### Using Composer

[](#using-composer)

As Symfony uses [Composer](http://getcomposer.org/) to manage its dependencies, the recommended way to install this bundle is to use it.

If you don't have Composer yet, download it following the instructions on  or just run the following command:

```
curl -s http://getcomposer.org/installer | php

```

Then, use the `require` command to download this bundle:

```
php composer.phar require wms/doctrine-extended-repository-bundle:~1.0@dev

```

Finally, edit your `AppKernel.php` file and add the bundle:

```
WMS\Bundle\DoctrineExtendedRepositoriesBundle\WMSDoctrineExtendedRepositoriesBundle()

```

2. Usage

---

In order to create a repository, simply create a new class using the following template:

```
use Doctrine\ORM;

class MyCustomRepository extends EntityRepository {
	private $dep;

    /**
     * Initializes a new EntityRepository.
     *
     * @param EntityManager         $em    The EntityManager to use.
     * @param Mapping\ClassMetadata $class The class descriptor.
     * @param MyDependency          $dep   The rest of the arguments are yours to choose!
     */
	public function __construct($em, Mapping\ClassMetadata $class, MyDependency $dep) {
		parent::__construct($em, $class);

		$this->dep = $dep;
	}
}
```

**IMPORTANT:** In order to be compatible with Doctrine repositories, the first two arguments of your repository are reserved to the entity manager and the `ClassMetadata` of your entity. These will be automatically injected.

Then, simply define your service:

\*\*XML: \*\*

```

```

\*\*YAML: \*\*

```
services:
	my_super_repository:
		class: MyCustomRepository
		arguments: [ @my_dependency ]
		tags:
			- { name: wms.doctrine_extended_repository, entity: "ACMEBundle:SuperEntity", connection: default }
```

You may omit the connection attribute on the tag. If so, it will use the default connection/entity manager.

The WMS Doctrine Extended Repository Bundle is released under the MIT license.

Enjoy!

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/eec8312178a397b682d2ad41200615ddadb11e1fb72816e511870063a186ec3e?d=identicon)[Andrew Moore](/maintainers/Andrew%20Moore)

---

Top Contributors

[![FineWolf](https://avatars.githubusercontent.com/u/203591?v=4)](https://github.com/FineWolf "FineWolf (3 commits)")

### Embed Badge

![Health badge](/badges/wms-doctrine-extended-repository-bundle/health.svg)

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

###  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)[mongodb/mongodb

MongoDB driver library

1.6k64.0M546](/packages/mongodb-mongodb)[ramsey/uuid-doctrine

Use ramsey/uuid as a Doctrine field type.

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

Reliese Components for Laravel Framework code generation.

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

PHPackages © 2026

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