[Doctrine] fixes php 5.4 notices in query