Code Duplication    Length = 4-14 lines in 2 locations

core/db_models/EEM_Base.model.php 2 locations

@@ 3923-3936 (lines=14) @@
3920
        );
3921
        //check to see if we have a field on this model
3922
        $this_model_fields = $this->field_settings(true);
3923
        if (array_key_exists($query_param, $this_model_fields)) {
3924
            if ($allow_fields) {
3925
                return;
3926
            }
3927
            throw new EE_Error(
3928
                sprintf(
3929
                    __(
3930
                        "Using a field name (%s) on model %s is not allowed on this query param type '%s'. Original query param was %s",
3931
                        "event_espresso"
3932
                    ),
3933
                    $query_param, get_class($this), $query_param_type, $original_query_param
3934
                )
3935
            );
3936
        }
3937
        //check if this is a special logic query param
3938
        if (in_array($query_param, $this->_logic_query_param_keys, true)) {
3939
            if ($allow_logic_query_params) {
@@ 5245-5248 (lines=4) @@
5242
    public function add_to_entity_map(EE_Base_Class $object)
5243
    {
5244
        $className = $this->_get_class_name();
5245
        if (! $object instanceof $className) {
5246
            throw new EE_Error(sprintf(__("You tried adding a %s to a mapping of %ss", "event_espresso"),
5247
                is_object($object) ? get_class($object) : $object, $className));
5248
        }
5249
        /** @var $object EE_Base_Class */
5250
        if (! $object->ID()) {
5251
            throw new EE_Error(sprintf(__("You tried storing a model object with NO ID in the %s entity mapper.",