I have setup a doctrine dbal connection in my config.yml.
it lets me access a remote db using this in my controller:
/** @var Connection $pgsql */ $pgsql = $this->getDoctrine()->getConnection('pgsql');
But this doesn’t work inside a listener. How do I connect to my remote db from inside my listener. I found and tried
$container = \Pimcore::getContainer(); $db = \Pimcore::getContainer()->get('doctrine.dbal.pgsql_connection');
but it does not work. It shows ‘doctrine.dbal.pgsql_connection’ as a missing service.