Code Duplication    Length = 11-13 lines in 2 locations

modules/single_page_checkout/inc/EE_Checkout.class.php 2 locations

@@ 1125-1137 (lines=13) @@
1122
	protected function _refresh_registration( $reg_cache_ID, $registration ) {
1123
1124
		// verify object
1125
		if ( $registration instanceof EE_Registration ) {
1126
			// update the entity mapper attendee
1127
			$this->_refresh_registration_attendee( $registration );
1128
			// update the entity mapper answers for reg form questions
1129
			$this->_refresh_registration_answers( $registration );
1130
			// make sure the cached registration is added to the model entity mapper
1131
			$registration->get_model()->refresh_entity_map_with( $reg_cache_ID, $registration );
1132
		} else {
1133
			EE_Error::add_error(
1134
				__( 'An invalid Registration object was discovered when attempting to update the model entity mapper.', 'event_espresso' ),
1135
				__FILE__, __FUNCTION__, __LINE__
1136
			);
1137
		}
1138
	}
1139
1140
@@ 1177-1187 (lines=11) @@
1174
		// now update the answers
1175
		foreach ( $registration->answers() as $cache_key => $answer ) {
1176
			// verify object
1177
			if ( $answer instanceof EE_Answer ) {
1178
				if ( $answer->ID() ) {
1179
					// make sure the cached answer is added to the model entity mapper
1180
					$answer->get_model()->refresh_entity_map_with( $answer->ID(), $answer );
1181
				}
1182
			} else {
1183
				EE_Error::add_error(
1184
					__( 'An invalid Answer object was discovered when attempting to update the model entity mapper.', 'event_espresso' ),
1185
					__FILE__, __FUNCTION__, __LINE__
1186
				);
1187
			}
1188
		}
1189
	}
1190