Code Duplication    Length = 15-15 lines in 2 locations

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

@@ 308-322 (lines=15) @@
305
	 * @global wpdb $wpdb
306
	 * @return string
307
	 */
308
	private function get_where_donor() {
309
		$where = '';
310
311
		// Specific donors.
312
		if ( ! empty( $this->args['donor'] ) ) {
313
			if ( ! is_array( $this->args['donor'] ) ) {
314
				$this->args['donor'] = explode( ',', $this->args['donor'] );
315
			}
316
			$donor_ids = implode( ',', array_map( 'intval', $this->args['donor'] ) );
317
318
			$where .= "AND {$this->table_name}.id IN( {$donor_ids} )";
319
		}
320
321
		return $where;
322
	}
323
324
	/**
325
	 * Set date where clause.
@@ 402-416 (lines=15) @@
399
	 * @global wpdb $wpdb
400
	 * @return string
401
	 */
402
	private function get_where_user() {
403
		$where = '';
404
405
		// Donors create for specific wp user.
406
		if ( ! empty( $this->args['user'] ) ) {
407
			if ( ! is_array( $this->args['user'] ) ) {
408
				$this->args['user'] = explode( ',', $this->args['user'] );
409
			}
410
			$user_ids = implode( ',', array_map( 'intval', $this->args['user'] ) );
411
412
			$where .= "AND {$this->table_name}.user_id IN( {$user_ids} )";
413
		}
414
415
		return $where;
416
	}
417
418
	/**
419
	 * Set orderby query