Code Duplication    Length = 12-15 lines in 3 locations

core/db_models/EEM_Base.model.php 3 locations

@@ 4226-4240 (lines=15) @@
4223
            $cleaned_value = $this->_construct_between_value($value, $field_obj);
4224
            return $operator . SP . $cleaned_value;
4225
        }
4226
        if (in_array($operator, $this->valid_null_style_operators())) {
4227
            if ($value !== null) {
4228
                throw new EE_Error(
4229
                    sprintf(
4230
                        __(
4231
                            "You attempted to give a value  (%s) while using a NULL-style operator (%s). That isn't valid",
4232
                            "event_espresso"
4233
                        ),
4234
                        $value,
4235
                        $operator
4236
                    )
4237
                );
4238
            }
4239
            return $operator;
4240
        }
4241
        if (in_array($operator, $this->valid_like_style_operators()) && ! is_array($value)) {
4242
            //if the operator is 'LIKE', we want to allow percent signs (%) and not
4243
            //remove other junk. So just treat it as a string.
@@ 4249-4260 (lines=12) @@
4246
        if (! in_array($operator, $this->valid_in_style_operators()) && ! is_array($value)) {
4247
            return $operator . SP . $this->_wpdb_prepare_using_field($value, $field_obj);
4248
        }
4249
        if (in_array($operator, $this->valid_in_style_operators()) && ! is_array($value)) {
4250
            throw new EE_Error(
4251
                sprintf(
4252
                    __(
4253
                        "Operator '%s' must be used with an array of values, eg 'Registration.REG_ID' => array('%s',array(1,2,3))",
4254
                        'event_espresso'
4255
                    ),
4256
                    $operator,
4257
                    $operator
4258
                )
4259
            );
4260
        }
4261
        if (! in_array($operator, $this->valid_in_style_operators()) && is_array($value)) {
4262
            throw new EE_Error(
4263
                sprintf(
@@ 4261-4272 (lines=12) @@
4258
                )
4259
            );
4260
        }
4261
        if (! in_array($operator, $this->valid_in_style_operators()) && is_array($value)) {
4262
            throw new EE_Error(
4263
                sprintf(
4264
                    __(
4265
                        "Operator '%s' must be used with a single value, not an array. Eg 'Registration.REG_ID => array('%s',23))",
4266
                        'event_espresso'
4267
                    ),
4268
                    $operator,
4269
                    $operator
4270
                )
4271
            );
4272
        }
4273
        throw new EE_Error(
4274
            sprintf(
4275
                __(