Skip to content
Snippets Groups Projects
Commit f1751471 authored by Jean-Philippe Metivier's avatar Jean-Philippe Metivier
Browse files

No more hardcoding

parent f1cc2269
Branches
Tags 6.0.1
No related merge requests found
Pipeline #19710 passed
......@@ -18,18 +18,14 @@ class SynchronisationServiceFactory {
*/
public function __invoke(ContainerInterface $container) : SynchronisationService
{
/**
* @var EntityManager $source
* @var EntityManager $destination
* @var SqlHelperService $sqlHelper
*/
// $source = $container->get('doctrine.entitymanager.orm_octopus');
$source = $container->get('doctrine.entitymanager.orm_default');
$destination = $container->get('doctrine.entitymanager.orm_default');
$entityManagers = [
'orm_octopus' => $source,
'orm_default' => $destination,
];
// TODO les récups directement de la conf doctrine ...
$sources = $container->get('Config')['data_sources'];
$entityManagers = [];
foreach ($sources as $source) {
$entityManagers[$source] = $container->get('doctrine.entitymanager.'. $source);
}
/** @var SqlHelperService $sqlHelper */
$sqlHelper = $container->get(SqlHelperService::class);
$configs = $container->get('Config')['synchros'];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment