Code Duplication    Length = 4-7 lines in 3 locations

core/db_classes/EE_Import.class.php 1 location

@@ 377-383 (lines=7) @@
374
	public function save_data_rows_to_db( $csv_data_array, $export_from_site_a_to_b, $old_db_to_new_db_mapping ) {
375
		foreach ( $csv_data_array as $model_name_in_csv_data => $model_data_from_import ) {
376
			//now check that assumption was correct. If
377
			if ( EE_Registry::instance()->is_model_name($model_name_in_csv_data)) {
378
				$model_name = $model_name_in_csv_data;
379
			}else {
380
				// no table info in the array and no table name passed to the function?? FAIL
381
				EE_Error::add_error( __('No table information was specified and/or found, therefore the import could not be completed','event_espresso'), __FILE__, __FUNCTION__, __LINE__ );
382
				return FALSE;
383
			}
384
			/* @var $model EEM_Base */
385
			$model = EE_Registry::instance()->load_model($model_name);
386

core/helpers/EEH_Activation.helper.php 1 location

@@ 463-466 (lines=4) @@
460
			) {
461
				//update Config with post ID
462
				$EE_Core_Config->{$critical_page[ 'id' ]} = $critical_page['post']->ID;
463
				if ( ! EE_Config::instance()->update_espresso_config( FALSE, FALSE ) ) {
464
					$msg = __( 'The Event Espresso critical page configuration settings could not be updated.', 'event_espresso' );
465
					EE_Error::add_error( $msg, __FILE__, __FUNCTION__, __LINE__ );
466
				}
467
			}
468
469
			$critical_page_problem =

modules/single_page_checkout/inc/EE_Checkout.class.php 1 location

@@ 1102-1107 (lines=6) @@
1099
					$this->cart->get_grand_total()
1100
				);
1101
			}
1102
			if ( $grand_total instanceof EE_Line_Item ) {
1103
				$this->cart = EE_Cart::instance( $grand_total );
1104
			} else {
1105
				EE_Error::add_error( __( 'A valid Cart was not found when attempting to update the model entity mapper.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
1106
				return false;
1107
			}
1108
		}
1109
		return TRUE;
1110
	}