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()) {
@@ 2672-2674 (lines=3) @@
2669
                $field_with_model_name = $field;
2670
            }
2671
        }
2672
        if (! isset($field_with_model_name) || ! $field_with_model_name) {
2673
            throw new EE_Error(sprintf(__("There is no EE_Any_Foreign_Model_Name field on model %s", "event_espresso"),
2674
                $this->get_this_model_name()));
2675
        }
2676
        return $field_with_model_name;
2677
    }
@@ 4843-4845 (lines=3) @@
4840
                }
4841
            }
4842
            $classInstance = $this->instantiate_class_from_array_or_object($row);
4843
            if (! $classInstance) {
4844
                throw new EE_Error(
4845
                    sprintf(
4846
                        __('Could not create instance of class %s from row %s', 'event_espresso'),
4847
                        $this->get_this_model_name(),
4848
                        http_build_query($row)