Code Duplication    Length = 11-11 lines in 2 locations

core/db_classes/EE_Export.class.php 1 location

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

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

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