replaced _(each) call with a for loop for perf reasons in updateAll of entity manager