value_options = array(); foreach (module_invoke_all('uc_product_types') as $type) { $this->value_options[$type] = $type; } } function query() { $this->query->add_field('uc_coupons', 'data'); if (is_array($this->value) && count($this->value)) { $search = implode("|", $this->value); $regexp = ".*product_types.*{[^}]*($search).*}"; $this->query->add_where_expression($this->options['group'], "uc_coupons.data " . ($this->options['operator'] !== 'in' ? "NOT " : "") . "REGEXP :re", array(':re' => $regexp) ); } } }