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()) {
@@ 2752-2754 (lines=3) @@
2749
                $field_with_model_name = $field;
2750
            }
2751
        }
2752
        if (! isset($field_with_model_name) || ! $field_with_model_name) {
2753
            throw new EE_Error(sprintf(__("There is no EE_Any_Foreign_Model_Name field on model %s", "event_espresso"),
2754
                $this->get_this_model_name()));
2755
        }
2756
        return $field_with_model_name;
2757
    }
@@ 4954-4956 (lines=3) @@
4951
                }
4952
            }
4953
            $classInstance = $this->instantiate_class_from_array_or_object($row);
4954
            if (! $classInstance) {
4955
                throw new EE_Error(
4956
                    sprintf(
4957
                        __('Could not create instance of class %s from row %s', 'event_espresso'),
4958
                        $this->get_this_model_name(),
4959
                        http_build_query($row)