src/Synapse/Db/DbServiceProvider.php
public function register(Application $app)
    {
        $app['db'] = $app->share(function ($app) {
            return new Adapter($app['config']->load('db'));
        });

        $app['db.transaction'] = $app->share(function ($app) {
            return new Transaction($app['db']);
        });

        $app->initializer(
            'Synapse\\Db\\TransactionAwareInterface',
            function ($object, $app) {
                $object->setTransaction($app['db.transaction']);
                return $object;
            }
        );

        $this->registerMapperInitializer($app);
    }
public function register(Application $app)
    {
        $app['db'] = $app->share(function ($app) {
            return new Adapter($app['config']->load('db'));
        });

        $app['db.transaction'] = $app->share(function ($app) {
            return new Transaction($app['db']);
        });

        $app->initializer(
            'Synapse\\Db\\TransactionAwareInterface',
            function ($object, $app) {
                $object->setTransaction($app['db.transaction']);
                return $object;
            }
        );

        $this->registerMapperInitializer($app);
    }
public function register ( Application $ app ) { $ app [ 'db' ] = $ app -> share ( function ( $ app ) { return new Adapter ( $ app [ 'config' ] -> load ( 'db' ) ) ; } ) ; $ app [ 'db.transaction' ] = $ app -> share ( function ( $ app ) { return new Transaction ( $ app [ 'db' ] ) ; } ) ; $ app -> initializer ( 'Synapse\\Db\\TransactionAwareInterface' , function ( $ object , $ app ) { $ object -> setTransaction ( $ app [ 'db.transaction' ] ) ; return $ object ; } ) ; $ this -> registerMapperInitializer ( $ app ) ; }
Register the database adapter

@param  Application $app Silex application
Register the database adapter