Code Duplication    Length = 12-15 lines in 3 locations

core/db_models/EEM_Base.model.php 3 locations

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