Code Duplication    Length = 9-9 lines in 2 locations

core/domain/services/graphql/connection_resolvers/DatetimeConnectionResolver.php 1 location

@@ 141-149 (lines=9) @@
138
        /**
139
         * Map the orderby inputArgs to the WP_Query
140
         */
141
        if (! empty($this->args['where']['orderby']) && is_array($this->args['where']['orderby'])) {
142
            $query_args['order_by'] = [];
143
            foreach ($this->args['where']['orderby'] as $orderby_input) {
144
                $query_args['order_by'][ $orderby_input['field'] ] = $orderby_input['order'];
145
            }
146
        } elseif ($offset) {
147
            $compare = ! empty($last) ? '<' : '>';
148
            $where_params['DTT_ID'] = array($compare, $offset);
149
        }
150
151
        if (! empty($this->args['where']['upcoming'])) {
152
            $where_params['DTT_EVT_start'] = array(

core/domain/services/graphql/connection_resolvers/TicketConnectionResolver.php 1 location

@@ 126-134 (lines=9) @@
123
        /**
124
         * Map the orderby inputArgs to the WP_Query
125
         */
126
        if (! empty($this->args['where']['orderby']) && is_array($this->args['where']['orderby'])) {
127
            $query_args['order_by'] = [];
128
            foreach ($this->args['where']['orderby'] as $orderby_input) {
129
                $query_args['order_by'][ $orderby_input['field'] ] = $orderby_input['order'];
130
            }
131
        } elseif ($offset) {
132
            $compare = ! empty($last) ? '<' : '>';
133
            $where_params['TKT_ID'] = array($compare, $offset);
134
        }
135
136
        $query_args[] = $where_params;
137