Code Duplication    Length = 15-15 lines in 2 locations

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

@@ 329-343 (lines=15) @@
326
	 * @global wpdb $wpdb
327
	 * @return string
328
	 */
329
	private function get_where_donor() {
330
		$where = '';
331
332
		// Specific donors.
333
		if ( ! empty( $this->args['donor'] ) ) {
334
			if ( ! is_array( $this->args['donor'] ) ) {
335
				$this->args['donor'] = explode( ',', $this->args['donor'] );
336
			}
337
			$donor_ids = implode( ',', array_map( 'intval', $this->args['donor'] ) );
338
339
			$where .= "AND {$this->table_name}.id IN( {$donor_ids} )";
340
		}
341
342
		return $where;
343
	}
344
345
	/**
346
	 * Set date where clause.
@@ 427-441 (lines=15) @@
424
	 * @global wpdb $wpdb
425
	 * @return string
426
	 */
427
	private function get_where_user() {
428
		$where = '';
429
430
		// Donors create for specific wp user.
431
		if ( ! empty( $this->args['user'] ) ) {
432
			if ( ! is_array( $this->args['user'] ) ) {
433
				$this->args['user'] = explode( ',', $this->args['user'] );
434
			}
435
			$user_ids = implode( ',', array_map( 'intval', $this->args['user'] ) );
436
437
			$where .= "AND {$this->table_name}.user_id IN( {$user_ids} )";
438
		}
439
440
		return $where;
441
	}
442
443
	/**
444
	 * Set orderby query