Code Duplication    Length = 3-9 lines in 3 locations

core/db_models/EEM_Base.model.php 3 locations

@@ 4928-4930 (lines=3) @@
4925
                }
4926
            }
4927
            $classInstance = $this->instantiate_class_from_array_or_object($row);
4928
            if (! $classInstance) {
4929
                throw new EE_Error(
4930
                    sprintf(
4931
                        __('Could not create instance of class %s from row %s', 'event_espresso'),
4932
                        $this->get_this_model_name(),
4933
                        http_build_query($row)
@@ 627-635 (lines=9) @@
624
                if (! $generator_object) {
625
                    continue;
626
                }
627
                if (! $generator_object instanceof EE_Restriction_Generator_Base) {
628
                    throw new EE_Error(
629
                        sprintf(
630
                            __('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.',
631
                                'event_espresso'),
632
                            $context,
633
                            $this->get_this_model_name()
634
                        )
635
                    );
636
                }
637
                $action = $this->cap_action_for_context($context);
638
                if (! $generator_object->construction_finalized()) {
@@ 2754-2756 (lines=3) @@
2751
                $field_with_model_name = $field;
2752
            }
2753
        }
2754
        if (! isset($field_with_model_name) || ! $field_with_model_name) {
2755
            throw new EE_Error(sprintf(__("There is no EE_Any_Foreign_Model_Name field on model %s", "event_espresso"),
2756
                $this->get_this_model_name()));
2757
        }
2758
        return $field_with_model_name;
2759
    }