Code Duplication    Length = 15-15 lines in 2 locations

includes/donors/class-give-donors-query.php 2 locations

@@ 297-311 (lines=15) @@
294
	 * @global wpdb $wpdb
295
	 * @return string
296
	 */
297
	private function get_where_donor() {
298
		$where = '';
299
300
		// Specific donors.
301
		if ( ! empty( $this->args['donor'] ) ) {
302
			if ( ! is_array( $this->args['donor'] ) ) {
303
				$this->args['donor'] = explode( ',', $this->args['donor'] );
304
			}
305
			$donor_ids = implode( ',', array_map( 'intval', $this->args['donor'] ) );
306
307
			$where .= "AND {$this->table_name}.id IN( {$donor_ids} )";
308
		}
309
310
		return $where;
311
	}
312
313
	/**
314
	 * Set date where clause.
@@ 391-405 (lines=15) @@
388
	 * @global wpdb $wpdb
389
	 * @return string
390
	 */
391
	private function get_where_user() {
392
		$where = '';
393
394
		// Donors create for specific wp user.
395
		if ( ! empty( $this->args['user'] ) ) {
396
			if ( ! is_array( $this->args['user'] ) ) {
397
				$this->args['user'] = explode( ',', $this->args['user'] );
398
			}
399
			$user_ids = implode( ',', array_map( 'intval', $this->args['user'] ) );
400
401
			$where .= "AND {$this->table_name}.user_id IN( {$user_ids} )";
402
		}
403
404
		return $where;
405
	}
406
407
	/**
408
	 * Set orderby query