PHPackages                             sebrogala/xsv-doctrine - 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. [Framework](/categories/framework)
4. /
5. sebrogala/xsv-doctrine

AbandonedArchivedLibrary[Framework](/categories/framework)

sebrogala/xsv-doctrine
======================

Middleware for Doctrine 2 integration with Zend Expressive

3.1.0(7y ago)0541proprietaryPHPPHP ^7.1

Since Feb 4Pushed 7y agoCompare

[ Source](https://github.com/SebRogala/xsv-doctrine)[ Packagist](https://packagist.org/packages/sebrogala/xsv-doctrine)[ Docs](https://github.com/SebRogala/xsv-doctrine)[ RSS](/packages/sebrogala-xsv-doctrine/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependencies (6)Versions (4)Used By (1)

Zend Expressive 3 Doctrine 2 Module
===================================

[](#zend-expressive-3-doctrine-2-module)

Middleware module which integrates Doctrine 2 with Zend Expressive 3.

Basic usage
-----------

[](#basic-usage)

From `data` directory copy `doctrine.local.php.dist` to `config/autoload` folder and remove `.dist` while saving credentials to database.

File `cli-config.php.dist` is needed inside `config` directory, as it's responsible for console use of Doctrine.

Enabale module in `config/config.php`:

```
$configManager = new ConfigManager([
    //...
    Xsv\Doctrine\ConfigProvider::class,
    //...
    new PhpFileProvider('config/autoload/{{,*.}global,{,*.}local}.php'),
]);
```

To get Entity Manager just use:

```
$em = $container->get(\Doctrine\ORM\EntityManager::class);
```

or as an alias:

```
$em = $container->get('entity-manager');
```

Create additional EntityManager
-------------------------------

[](#create-additional-entitymanager)

To create one it is required to create new Class or Interface and provide new configuration for it's name. For example: inside `src/App/Service` create `SomeEntityManager` file:

```
