Closed rufinus closed 9 years ago
Why do you even set $this->_em ? if you're talking about L74 in Datatable.php, I'm not sure why I have that maybe it was used before and after some refactoring it become useless. Anyway, I definitely need to remove that .
About you issue, I agree having a clean way to set the entity manager in datatable would be helpful. Any suggestion about where you wanna set it ? I'm thinking about two places :
I'm open to suggestions.
Update is added in the commit 166d4cd937da47da05045efdb360f07eb87fb4e0. No "fix issue" message since this is a feature.
I have a project which needs to use two different databases, via different connections. so i have to set the entitymanager for some of the datatables.
I currently extend your class and added an setEm() method, but this should be supported by default.
Of course this is not enough, your QueryBuilder doesnt get the EntityManger from its parent object, but again from the container.
Why do you even set $this->_em ?