2017 © Pedro Peláez
 

library zend2-doctrine-dynamic-db

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

image

rradutzu/zend2-doctrine-dynamic-db

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

  • Thursday, July 6, 2017
  • by rradutzu
  • Repository
  • 1 Watchers
  • 0 Stars
  • 749 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 9 Versions
  • 30 % Grown

The README.md

Doctrine Dynamic Db Adapter

Zend2 Doctrine Module that allows defining connections using dynamic database names, (*1)

#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:

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

The Versions

06/07 2017

dev-develop

dev-develop

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

  Sources   Download

GPL-2.0

The Requires

 

06/07 2017

dev-master

9999999-dev

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

  Sources   Download

GPL-2.0

The Requires

 

06/07 2017

1.0.3

1.0.3.0

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

  Sources   Download

GPL-2.0

The Requires

 

06/07 2017

1.0.2

1.0.2.0

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

  Sources   Download

GPL-2.0

The Requires

 

06/07 2017

1.0.1

1.0.1.0

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

  Sources   Download

GPL-2.0

The Requires

 

05/07 2017

1.0.0

1.0.0.0

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

  Sources   Download

GPL-2.0

The Requires

 

03/12 2015

0.0.4

0.0.4.0

Zend2 Doctrine Module that allows defining connections using dynamic database names

  Sources   Download

GPL-2.0

The Requires

 

03/12 2015

0.0.3

0.0.3.0

Zend2 Doctrine Module that allows defining connections using dynamic database names

  Sources   Download

The Requires

 

03/12 2015

0.0.2

0.0.2.0

Zend2 Doctrine Module that allows defining connections using dynamic database names

  Sources   Download

The Requires