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

Recuperation des entity managers depuis la conf

parent f1751471
Branches
Tags
No related merge requests found
Pipeline #22349 passed
......@@ -18,16 +18,15 @@ class SynchronisationServiceFactory {
*/
public function __invoke(ContainerInterface $container) : SynchronisationService
{
// TODO les récups directement de la conf doctrine ...
$sources = $container->get('Config')['data_sources'];
// récupération des entity managers déclarés
$sources = $container->get('Config')['doctrine']['entitymanager'];
$entityManagers = [];
foreach ($sources as $source) {
$entityManagers[$source] = $container->get('doctrine.entitymanager.'. $source);
foreach ($sources as $id => $data) {
$entityManagers[$id] = $container->get('doctrine.entitymanager.'. $id);
}
/** @var SqlHelperService $sqlHelper */
$sqlHelper = $container->get(SqlHelperService::class);
$configs = $container->get('Config')['synchros'];
$service = new SynchronisationService();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment