query::_entityConditions() most return array.
Adding all conditions relevant to relations in hasMany.
Merge pull request #1141 from koushki/bug/database

don't apply relation conditions when there is more than one hasMany relation.