ActionScheduler_DBStore::get_claim_count()publicWC 1.0

Get the number of active claims.

Method of the class: ActionScheduler_DBStore{}

No Hooks.

Return

Int.

Usage

$ActionScheduler_DBStore = new ActionScheduler_DBStore();
$ActionScheduler_DBStore->get_claim_count();

ActionScheduler_DBStore::get_claim_count() code WC 9.3.1

public function get_claim_count() {
	global $wpdb;

	$sql = "SELECT COUNT(DISTINCT claim_id) FROM {$wpdb->actionscheduler_actions} WHERE claim_id != 0 AND status IN ( %s, %s)";
	$sql = $wpdb->prepare( $sql, array( self::STATUS_PENDING, self::STATUS_RUNNING ) ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared

	return (int) $wpdb->get_var( $sql ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared
}