Code Duplication    Length = 3-9 lines in 3 locations

core/db_models/EEM_Base.model.php 3 locations

@@ 528-536 (lines=9) @@
525
				if( ! $generator_object ){
526
					continue;
527
				}
528
				if( ! $generator_object instanceof EE_Restriction_Generator_Base ){
529
					throw new EE_Error(
530
						sprintf(
531
							__( '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.', 'event_espresso' ),
532
							$context,
533
							$this->get_this_model_name()
534
						)
535
					);
536
				}
537
				$action = $this->cap_action_for_context( $context );
538
				if( ! $generator_object->construction_finalized() ){
539
					$generator_object->_construct_finalize( $this, $action );
@@ 2288-2290 (lines=3) @@
2285
				$field_with_model_name = $field;
2286
			}
2287
		}
2288
		if( !isset($field_with_model_name) || !$field_with_model_name ){
2289
			throw new EE_Error(sprintf(__("There is no EE_Any_Foreign_Model_Name field on model %s", "event_espresso"), $this->get_this_model_name() ));
2290
		}
2291
		return $field_with_model_name;
2292
	}
2293
@@ 4069-4071 (lines=3) @@
4066
				}
4067
			}
4068
			$classInstance = $this->instantiate_class_from_array_or_object($row);
4069
			if( ! $classInstance ) {
4070
				throw new EE_Error(
4071
					sprintf(
4072
						__( 'Could not create instance of class %s from row %s', 'event_espresso' ),
4073
						$this->get_this_model_name(),
4074
						http_build_query( $row )