hwi/HWIOAuthBundle — pull request #696 by gnutix (2014-12-09 18:36:20+00:00)
Title: Avoid logic to be executed at class initialization

When using the Oro Platform (or sub-products, like OroCRM), the entity manager is overridden at runtime in order to add dynamic fields to entities (via configuration).

However, if a repository is fetched in the constructor of a service (like it was the case here), the repository does not yet have this runtime magic applied and it breaks the application.

This commit is meant to delay the fetching of the repository to the last possible moment (when querying for users), so that the kernel loading process does not break applications. Moreover, I think removing any logic from the constructor is a good idea overall.