+
+ static function buildWhereAndQill(&$query, $value, $pseudoconstantType, $op, $grouping, $params) {
+ $matches = $val = $clause = array();
+
+ if (is_array($value)) {
+ foreach ($value as $k => $v) {
+ if ($k) {
+ $val[] = $k;
+ }
+ }
+
+ if (count($val) > 0) {
+ // Overwrite $op so it works with an IN where statement.
+ $op = 'IN';
+ }
+ else {
+ // If we somehow have an empty array, just return
+ return;
+ }
+ $value = $matches[0] = $val;
+ }
+ else {
+ preg_match_all('/\d+/', $value, $matches);
+ }
+ foreach ($matches[0] as $qill) {
+ $clause[] = CRM_Utils_Array::value($qill, $pseudoconstantType);
+ }
+
+ $query->_qill[$grouping][] = ts($params[0] . ' %1 ', array(1 => $op)) . implode(' ' . ts('or') . ' ', $clause);
+ $query->_where[$grouping][] = CRM_Contact_BAO_Query::buildClause($params[1],
+ $op, $value, "Integer"
+ );
+ return $matches[0];
+ }