Rewrite to use Doctrine DBAL.