Added functionality for multiple Entity Managers when using Doctrine.