refarctored where conditions inside zend\db