PHPackages                             xm/doctrine-entity-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. xm/doctrine-entity-repository

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

xm/doctrine-entity-repository
=============================

A different method of creating entity repositories for use with Doctrine.

1.0.0(8y ago)0112MITPHPPHP ^7.1

Since Aug 17Pushed 8y ago2 watchersCompare

[ Source](https://github.com/xmmedia/doctrine-entity-repository)[ Packagist](https://packagist.org/packages/xm/doctrine-entity-repository)[ Docs](https://github.com/xmmedia/doctrine-entity-repository)[ RSS](/packages/xm-doctrine-entity-repository/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

XM\\Doctrine Entity Repository
==============================

[](#xmdoctrine-entity-repository)

A different way of creating Doctrine Repositories based on [this article](https://blog.fervo.se/blog/2017/07/06/doctrine-repositories-autowiring/) by Magnus Nordlander. The main difference (as opposed to "normal" Doctrine Repositories) is that these can be autowired by Symfony. We've also found them easier to test.

Repositories extending this class should not be referenced by the `repositoryClass` entity mapping. But the repository can be used in the same way as "normal" [Doctrine Entity Repositories](https://symfony.com/doc/current/doctrine/repository.html).

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

[](#installation)

Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:

```
composer require xm/doctrine-entity-repository
```

This command requires [Composer](https://getcomposer.org/download/).

Usage
-----

[](#usage)

```
