building doctrine query