WordPress at Your Fingertips
function is not described

ActionScheduler_DBStore::find_actions_by_claim_id() public WC 1.0

Retrieve the action IDs of action in a claim.

{} It's a method of the class: ActionScheduler_DBStore{}

No Hooks.

Return

Int[].

Usage

$ActionScheduler_DBStore = new ActionScheduler_DBStore();
$ActionScheduler_DBStore->find_actions_by_claim_id( $claim_id );
$claim_id(int) (required)
Claim ID.

Code of ActionScheduler_DBStore::find_actions_by_claim_id() WC 6.1.1

public function find_actions_by_claim_id( $claim_id ) {
	/** @var \wpdb $wpdb */
	global $wpdb;

	$action_ids  = array();
	$before_date = isset( $this->claim_before_date ) ? $this->claim_before_date : as_get_datetime_object();
	$cut_off     = $before_date->format( 'Y-m-d H:i:s' );

	$sql = $wpdb->prepare(
		"SELECT action_id, scheduled_date_gmt FROM {$wpdb->actionscheduler_actions} WHERE claim_id = %d",
		$claim_id
	);

	// Verify that the scheduled date for each action is within the expected bounds (in some unusual
	// cases, we cannot depend on MySQL to honor all of the WHERE conditions we specify).
	foreach ( $wpdb->get_results( $sql ) as $claimed_action ) { // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared
		if ( $claimed_action->scheduled_date_gmt <= $cut_off ) {
			$action_ids[] = absint( $claimed_action->action_id );
		}
	}

	return $action_ids;
}