PHPackages                             rradutzu/zend2-doctrine-dynamic-db - 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. rradutzu/zend2-doctrine-dynamic-db

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

rradutzu/zend2-doctrine-dynamic-db
==================================

Zend2/3 Doctrine Module that allows defining connections using dynamic database names

3.0.2(1y ago)015.4k↓16.7%GPL-2.0PHP

Since Dec 3Pushed 1y ago2 watchersCompare

[ Source](https://github.com/rradutzu/zend2-doctrine-dynamic-db)[ Packagist](https://packagist.org/packages/rradutzu/zend2-doctrine-dynamic-db)[ RSS](/packages/rradutzu-zend2-doctrine-dynamic-db/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (20)Used By (0)

Doctrine Dynamic Db Adapter
===========================

[](#doctrine-dynamic-db-adapter)

Zend2 Doctrine Module that allows defining connections using dynamic database names

\#Usage
-------

[](#usage)

1. Include 'DoctrineDynamicDb' in your modules.config.php file

---

2. Add to the used connection the 'dbNameFactory' param.:

---

```
return array(
    //...
    'doctrine' => array(
        'connection' => array(
            //...
            'orm_dynamic' => array(
                'driverClass' => 'Doctrine\DBAL\Driver\PDOMySql\Driver',
                    'params' => array(
                    'host'     => 'localhost',
                    'port'     => '3306',
                    'user'     => 'root',
                    'password' => 'kotor3',
                    'dbname'   => '%',

                    // this needs to return instance of DoctrineMultiDbAdapter\Client\ClientInterface,
                    // a custom object or a string which represents the db name
                    'dbNameFactory' => 'ClientFactory',
                    // optional | name of the method used to retrieve the db name if dbNameFactory
                    // returns a custom object
                    'dbNameFactoryMethod' => 'getClientDb'
                )
            )
        ),
        'dynamic_entitymanager' => array(
            // need to add the connection to the new entity manager
            'orm_dynamic' => array()
        )
    ),
    //...
);

```

3.Get the entity manager for the dynamic connection using:
----------------------------------------------------------

[](#3get-the-entity-manager-for-the-dynamic-connection-using)

```
$em = $serviceLocator->get('doctrine.dynamic_entitymanager.##connection_name##');

```

###  Health Score

42

—

FairBetter than 90% of packages

Maintenance46

Moderate activity, may be stable

Popularity24

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity72

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

Recently: every ~24 days

Total

16

Last Release

420d ago

Major Versions

0.0.4 → 1.0.02017-07-05

1.0.3 → 2.0.02023-09-25

1.0.8 → 3.0.02025-03-19

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1751701?v=4)[Gurita Radu](/maintainers/rradutzu)[@rradutzu](https://github.com/rradutzu)

---

Top Contributors

[![rradutzu](https://avatars.githubusercontent.com/u/1751701?v=4)](https://github.com/rradutzu "rradutzu (1 commits)")

### Embed Badge

![Health badge](/badges/rradutzu-zend2-doctrine-dynamic-db/health.svg)

```
[![Health](https://phpackages.com/badges/rradutzu-zend2-doctrine-dynamic-db/health.svg)](https://phpackages.com/packages/rradutzu-zend2-doctrine-dynamic-db)
```

###  Alternatives

[doctrine/doctrine-orm-module

Laminas Module that provides Doctrine ORM functionality

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

Laminas Module that provides Doctrine basic functionality required for ORM and ODM modules

3957.9M116](/packages/doctrine-doctrine-module)[doctrine/doctrine-mongo-odm-module

Laminas Module which provides Doctrine MongoDB ODM functionality

86676.6k35](/packages/doctrine-doctrine-mongo-odm-module)[zf-commons/zfc-user-doctrine-orm

Doctrine2 ORM storage adapter for ZfcUser.

85676.8k18](/packages/zf-commons-zfc-user-doctrine-orm)[hounddog/doctrine-data-fixture-module

Zend Framework 2 Module that provides Doctrine Data-Fixture functionality

37335.4k9](/packages/hounddog-doctrine-data-fixture-module)[zfc-datagrid/zfc-datagrid

Laminas Module that provides a datagrid for different datasources and output formats

1223.2k](/packages/zfc-datagrid-zfc-datagrid)

PHPackages © 2026

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