Using doctrine entities for database interactions