add([ 'doctrine' => function (EntityManager $em, $arguments) { $connection = $em->getResponsibleEntityManager($arguments[0] ?? 'default'); return ConsoleRunner::createHelperSet($connection); }, ]), 'doctrine.debug' => get('debug'), 'doctrine.single-connection' => false, 'em' => get(EntityManager::class), EntityManager::class => factory(function (Container $c) { $contextAware = $c->get(ContextAwareEntityManager::class); if ($c->get('doctrine.single-connection')) { return $contextAware->getResponsibleEntityManager('default'); } return $contextAware; }), ], connections([ 'example' => [ 'connection' => [ 'driver' => 'pdo_mysql', 'hostname' => 'localhost', 'password' => '', 'user' => 'root', 'dbname' => 'ipsum', ], 'entity-paths' => realpath(__DIR__ . '/../src/Entity') ], 'default' => [ 'connection' => add([ 'driver' => 'pdo_mysql', 'hostname' => 'localhost', 'password' => '', 'user' => 'root', ]), 'entity-paths' => add([ string('{basedir}/src/Entity') ]), ] ]) );