Doctrine 1

Sub queries do not work properly in the on clause of a join