Code Duplication    Length = 3-9 lines in 3 locations

core/db_models/EEM_Base.model.php 3 locations

@@ 631-639 (lines=9) @@
628
                if (! $generator_object) {
629
                    continue;
630
                }
631
                if (! $generator_object instanceof EE_Restriction_Generator_Base) {
632
                    throw new EE_Error(
633
                        sprintf(
634
                            __('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.',
635
                                'event_espresso'),
636
                            $context,
637
                            $this->get_this_model_name()
638
                        )
639
                    );
640
                }
641
                $action = $this->cap_action_for_context($context);
642
                if (! $generator_object->construction_finalized()) {
@@ 2694-2696 (lines=3) @@
2691
                $field_with_model_name = $field;
2692
            }
2693
        }
2694
        if (! isset($field_with_model_name) || ! $field_with_model_name) {
2695
            throw new EE_Error(sprintf(__("There is no EE_Any_Foreign_Model_Name field on model %s", "event_espresso"),
2696
                $this->get_this_model_name()));
2697
        }
2698
        return $field_with_model_name;
2699
    }
@@ 4865-4867 (lines=3) @@
4862
                }
4863
            }
4864
            $classInstance = $this->instantiate_class_from_array_or_object($row);
4865
            if (! $classInstance) {
4866
                throw new EE_Error(
4867
                    sprintf(
4868
                        __('Could not create instance of class %s from row %s', 'event_espresso'),
4869
                        $this->get_this_model_name(),
4870
                        http_build_query($row)