Code Duplication    Length = 7-7 lines in 2 locations

caffeinated/admin/extend/events/Extend_Events_Admin_Page.core.php 2 locations

@@ 475-481 (lines=7) @@
472
		//now we need to get the question group relations and handle that
473
		//first primary question groups
474
		$orig_primary_qgs = $orig_event->get_many_related('Question_Group', array( array('Event_Question_Group.EQG_primary' => 1 ) ) );
475
		if ( !empty( $orig_primary_qgs ) ) {
476
			foreach ( $orig_primary_qgs as $id => $obj ) {
477
				if ( $obj instanceof EE_Question_Group ) {
478
					$new_event->_add_relation_to( $obj, 'Question_Group', array( 'EQG_primary' => 1 ) );
479
				}
480
			}
481
		}
482
483
		//next additional attendee question groups
484
		$orig_additional_qgs = $orig_event->get_many_related('Question_Group', array( array('Event_Question_Group.EQG_primary' => 0 ) ) );
@@ 485-491 (lines=7) @@
482
483
		//next additional attendee question groups
484
		$orig_additional_qgs = $orig_event->get_many_related('Question_Group', array( array('Event_Question_Group.EQG_primary' => 0 ) ) );
485
		if ( !empty( $orig_additional_qgs ) ) {
486
			foreach ( $orig_additional_qgs as $id => $obj ) {
487
				if ( $obj instanceof EE_Question_Group ) {
488
					$new_event->_add_relation_to( $obj, 'Question_Group', array( 'EQG_primary' => 0 ) );
489
				}
490
			}
491
		}
492
493
		//now save
494
		$new_event->save();