Allows dependencies to be injected into doctrine objects.