WordPress at Your Fingertips
function is not described

Action_Scheduler\Migration

BatchFetcher::get_query_strategies() private WC 1.0

Generate a list of prioritized of action search parameters.

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

No Hooks.

Return

Array.

Usage

// private - for code of main (parent) class only
$result = $this->get_query_strategies( $count );
$count(int) (required)
Number of actions to find.

Code of BatchFetcher::get_query_strategies() WC 6.1.1

private function get_query_strategies( $count ) {
	$now  = as_get_datetime_object();
	$args = [
		'date'     => $now,
		'per_page' => $count,
		'offset'   => 0,
		'orderby'  => 'date',
		'order'    => 'ASC',
	];

	$priorities = [
		Store::STATUS_PENDING,
		Store::STATUS_FAILED,
		Store::STATUS_CANCELED,
		Store::STATUS_COMPLETE,
		Store::STATUS_RUNNING,
		'', // any other unanticipated status
	];

	foreach ( $priorities as $status ) {
		yield wp_parse_args( [
			'status'       => $status,
			'date_compare' => '<=',
		], $args );
		yield wp_parse_args( [
			'status'       => $status,
			'date_compare' => '>=',
		], $args );
	}
}