Code Duplication    Length = 16-16 lines in 2 locations

includes/class-give-db-comments.php 1 location

@@ 216-231 (lines=16) @@
213
	 *
214
	 * @return int
215
	 */
216
	public function count( $args = array() ) {
217
		/* @var WPDB $wpdb */
218
		global $wpdb;
219
		$args['number'] = - 1;
220
		$args['fields'] = 'ID';
221
		$args['count']  = true;
222
223
		$sql_query = $this->get_sql( $args );
224
225
		if ( ! ( $count = Give_Cache::get( 'give_comments_count', true, $sql_query ) ) ) {
226
			$count = $wpdb->get_var( $sql_query );
227
			Give_Cache::set( 'give_comments_count', $count, 3600, true, $args );
228
		}
229
230
		return absint( $count );
231
	}
232
233
	/**
234
	 * Create the table

includes/class-give-db-logs.php 1 location

@@ 216-231 (lines=16) @@
213
	 *
214
	 * @return int
215
	 */
216
	public function count( $args = array() ) {
217
		/* @var WPDB $wpdb */
218
		global $wpdb;
219
		$args['number'] = - 1;
220
		$args['fields'] = 'ID';
221
		$args['count']  = true;
222
223
		$sql_query = $this->get_sql( $args );
224
225
		if ( ! ( $count = Give_Cache::get( 'give_logs_count', true, $sql_query ) ) ) {
226
			$count = $wpdb->get_var( $sql_query );
227
			Give_Cache::set( 'give_logs_count', $count, 3600, true, $args );
228
		}
229
230
		return absint( $count );
231
	}
232
233
	/**
234
	 * Create the table