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

@@ 427-430 (lines=4) @@
424
			) {
425
				//update Config with post ID
426
				$EE_Core_Config->{$critical_page[ 'id' ]} = $critical_page['post']->ID;
427
				if ( ! EE_Config::instance()->update_espresso_config( FALSE, FALSE ) ) {
428
					$msg = __( 'The Event Espresso critical page configuration settings could not be updated.', 'event_espresso' );
429
					EE_Error::add_error( $msg, __FILE__, __FUNCTION__, __LINE__ );
430
				}
431
			}
432
433
			$critical_page_problem =

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

@@ 1110-1115 (lines=6) @@
1107
					$this->cart->get_grand_total()
1108
				);
1109
			}
1110
			if ( $grand_total instanceof EE_Line_Item ) {
1111
				$this->cart = EE_Cart::instance( $grand_total );
1112
			} else {
1113
				EE_Error::add_error( __( 'A valid Cart was not found when attempting to update the model entity mapper.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
1114
				return false;
1115
			}
1116
		}
1117
		return TRUE;
1118
	}