Skip to content

Latest commit

 

History

History
52 lines (42 loc) · 1.38 KB

README.md

File metadata and controls

52 lines (42 loc) · 1.38 KB

DBALManagerBundle

SensioLabsInsight

This bundle provides DBALManager as a Symfony service.

Installation:

  1. Run: composer require jarjak/dbal-manager-bundle

  2. [Symfony <4 only] Add bundle to your AppKernel.php:

class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            //...
            new JarJak\DBALManagerBundle\JarJakDBALManagerBundle(),
        );
        //...
        return $bundles;
    }
    //...
}

Usage examples:

You can get DBALManager as service in two ways:

$container->get('jarjak.dbal_manager');
$container->get(DBALManager::class);

For usage examples please refer to DBALManager documentation.

Multiple database connections

If you have more than one DB connection, then you can create multiple managers, one for each connection. All you need is to pass DBAL Connection service (@secondary_connection) to setConnection() or constructor.

secondary_dbal_manager:
    class: JarJak\DBALManager
    arguments:
        - "@secondary_connection"