Code Duplication    Length = 15-15 lines in 2 locations

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

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