Changed database interaction to use Doctrine/DBAL