Code Duplication    Length = 3-9 lines in 3 locations

core/db_models/EEM_Base.model.php 3 locations

@@ 635-643 (lines=9) @@
632
                if (! $generator_object) {
633
                    continue;
634
                }
635
                if (! $generator_object instanceof EE_Restriction_Generator_Base) {
636
                    throw new EE_Error(
637
                        sprintf(
638
                            __('Index "%1$s" in the model %2$s\'s _cap_restriction_generators is not a child of EE_Restriction_Generator_Base. It should be that or NULL.',
639
                                'event_espresso'),
640
                            $context,
641
                            $this->get_this_model_name()
642
                        )
643
                    );
644
                }
645
                $action = $this->cap_action_for_context($context);
646
                if (! $generator_object->construction_finalized()) {
@@ 2738-2740 (lines=3) @@
2735
                $field_with_model_name = $field;
2736
            }
2737
        }
2738
        if (! isset($field_with_model_name) || ! $field_with_model_name) {
2739
            throw new EE_Error(sprintf(__("There is no EE_Any_Foreign_Model_Name field on model %s", "event_espresso"),
2740
                $this->get_this_model_name()));
2741
        }
2742
        return $field_with_model_name;
2743
    }
@@ 4940-4942 (lines=3) @@
4937
                }
4938
            }
4939
            $classInstance = $this->instantiate_class_from_array_or_object($row);
4940
            if (! $classInstance) {
4941
                throw new EE_Error(
4942
                    sprintf(
4943
                        __('Could not create instance of class %s from row %s', 'event_espresso'),
4944
                        $this->get_this_model_name(),
4945
                        http_build_query($row)