ActionScheduler_HybridStore::stake_claimpublicWC 1.0

If any actions would have been claimed by the secondary store, migrate them immediately, then ask the primary store for the canonical claim.

Method of the class: ActionScheduler_HybridStore{}

No Hooks.

Returns

ActionScheduler_ActionClaim.

Usage

$ActionScheduler_HybridStore = new ActionScheduler_HybridStore();
$ActionScheduler_HybridStore->stake_claim( $max_actions, ?DateTime $before_date, $hooks, $group );
$max_actions(int)
Maximum number of actions to claim.
Default: 10
?DateTime $before_date
.
Default: null
$hooks(string[])
Hook of actions to claim.
Default: array()
$group(string)
Group of actions to claim.
Default: ''

ActionScheduler_HybridStore::stake_claim() code WC 10.3.3

public function stake_claim( $max_actions = 10, ?DateTime $before_date = null, $hooks = array(), $group = '' ) {
	$claim = $this->secondary_store->stake_claim( $max_actions, $before_date, $hooks, $group );

	$claimed_actions = $claim->get_actions();
	if ( ! empty( $claimed_actions ) ) {
		$this->migrate( $claimed_actions );
	}

	$this->secondary_store->release_claim( $claim );

	return $this->primary_store->stake_claim( $max_actions, $before_date, $hooks, $group );
}