Code Duplication    Length = 11-11 lines in 2 locations

core/db_classes/EE_Export.class.php 1 location

@@ 452-462 (lines=11) @@
449
				//add attendee columns
450
				foreach($att_fields_to_include as $att_field_name){
451
					$field_obj = EEM_Attendee::instance()->field_settings_for($att_field_name);
452
					if( $reg_row[ 'Attendee_CPT.ID' ]){
453
						if($att_field_name == 'STA_ID'){
454
							$value = EEM_State::instance()->get_var( array( array( 'STA_ID' => $reg_row[ 'Attendee_Meta.STA_ID' ] ) ), 'STA_name' );
455
						}elseif($att_field_name == 'CNT_ISO'){
456
							$value = EEM_Country::instance()->get_var( array( array( 'CNT_ISO' => $reg_row[ 'Attendee_Meta.CNT_ISO' ] ) ), 'CNT_name' );
457
						}else{
458
							$value = $this->_prepare_value_from_db_for_display( EEM_Attendee::instance(), $att_field_name, $reg_row[ $field_obj->get_qualified_column() ] );
459
						}
460
					}else{
461
						$value = '';
462
					}
463
464
					$reg_csv_array[$this->_get_column_name_for_field($field_obj)] = $value;
465
				}

core/libraries/batch/JobHandlers/RegistrationsReport.php 1 location

@@ 293-303 (lines=11) @@
290
				//add attendee columns
291
				foreach($att_fields_to_include as $att_field_name){
292
					$field_obj = \EEM_Attendee::instance()->field_settings_for($att_field_name);
293
					if( $reg_row[ 'Attendee_CPT.ID' ]){
294
						if($att_field_name == 'STA_ID'){
295
							$value = \EEM_State::instance()->get_var( array( array( 'STA_ID' => $reg_row[ 'Attendee_Meta.STA_ID' ] ) ), 'STA_name' );
296
						}elseif($att_field_name == 'CNT_ISO'){
297
							$value = \EEM_Country::instance()->get_var( array( array( 'CNT_ISO' => $reg_row[ 'Attendee_Meta.CNT_ISO' ] ) ), 'CNT_name' );
298
						}else{
299
							$value = \EEH_Export::prepare_value_from_db_for_display( \EEM_Attendee::instance(), $att_field_name, $reg_row[ $field_obj->get_qualified_column() ] );
300
						}
301
					}else{
302
						$value = '';
303
					}
304
305
					$reg_csv_array[ \EEH_Export::get_column_name_for_field($field_obj) ] = $value;
306
				}