Code Duplication    Length = 5-5 lines in 3 locations

core/db_classes/EE_Export.class.php 1 location

@@ 353-357 (lines=5) @@
350
			),
351
			$event_id
352
		);
353
		if( $event_id ){
354
			$query_params[0]['EVT_ID'] =  $event_id;
355
		}else{
356
			$query_params[ 'force_join' ][] = 'Event';
357
		}
358
		$registration_rows = $reg_model->get_all_wpdb_results( $query_params );
359
		//get all questions which relate to someone in this group
360
		$registration_ids = array();

core/libraries/batch/JobHandlers/RegistrationsReport.php 2 locations

@@ 191-195 (lines=5) @@
188
                'limit'      => array($offset, $limit),
189
                'caps'       => \EEM_Base::caps_read_admin,
190
            ), $event_id);
191
        if ($event_id) {
192
            $query_params[0]['EVT_ID'] = $event_id;
193
        } else {
194
            $query_params['force_join'][] = 'Event';
195
        }
196
        $registration_rows = $reg_model->get_all_wpdb_results($query_params);
197
        //get all questions which relate to someone in this group
198
        $registration_ids = array();
@@ 406-410 (lines=5) @@
403
                'force_join' => array('Transaction', 'Ticket', 'Attendee'),
404
                'caps'       => \EEM_Base::caps_read_admin,
405
            ), $event_id);
406
        if ($event_id) {
407
            $query_params[0]['EVT_ID'] = $event_id;
408
        } else {
409
            $query_params['force_join'][] = 'Event';
410
        }
411
        return \EEM_Registration::instance()->count($query_params);
412
    }
413