Code Duplication    Length = 5-5 lines in 3 locations

core/db_models/EEM_Event.model.php 3 locations

@@ 546-550 (lines=5) @@
543
        //let's add specific query_params for active_events - keep in mind this will override any sent status in the query AND any date queries.
544
        $where_params['status'] = array( 'IN', array( 'publish', EEM_Event::sold_out ) );
545
        //if already have where params for DTT_EVT_start or DTT_EVT_end then append these conditions
546
        if (isset($where_params['Datetime.DTT_EVT_start'])) {
547
            $where_params['Datetime.DTT_EVT_start******'] = array(
548
                '<',
549
                EEM_Datetime::instance()->current_time_for_query('DTT_EVT_start')
550
            );
551
        } else {
552
            $where_params['Datetime.DTT_EVT_start'] = array(
553
                '<',
@@ 558-562 (lines=5) @@
555
            );
556
        }
557
        
558
        if (isset($where_params['Datetime.DTT_EVT_end'])) {
559
            $where_params['Datetime.DTT_EVT_end*****'] = array(
560
                '>',
561
                EEM_Datetime::instance()->current_time_for_query('DTT_EVT_end')
562
            );
563
        } else {
564
            $where_params['Datetime.DTT_EVT_end'] = array(
565
                '>',
@@ 604-608 (lines=5) @@
601
        //let's add specific query_params for active_events - keep in mind this will override any sent status in the query AND any date queries.
602
        $where_params['status'] = array( 'IN', array( 'publish', EEM_Event::sold_out ) );
603
        //if there are already query_params matching DTT_EVT_start then we need to modify that to add them.
604
        if (isset($where_params['Datetime.DTT_EVT_start'])) {
605
            $where_params['Datetime.DTT_EVT_start*****'] = array(
606
                '>',
607
                EEM_Datetime::instance()->current_time_for_query('DTT_EVT_start')
608
            );
609
        } else {
610
            $where_params['Datetime.DTT_EVT_start'] = array(
611
                '>',