Action_Scheduler\Migration
BatchFetcher::get_query_strategies
Generate a list of prioritized of action search parameters.
Method of the class: BatchFetcher{}
No Hooks.
Returns
Array.
Usage
// private - for code of main (parent) class only $result = $this->get_query_strategies( $count );
- $count(int) (required)
- Number of actions to find.
BatchFetcher::get_query_strategies() BatchFetcher::get query strategies code WC 10.7.0
private function get_query_strategies( $count ) {
$now = as_get_datetime_object();
$args = array(
'date' => $now,
'per_page' => $count,
'offset' => 0,
'orderby' => 'date',
'order' => 'ASC',
);
$priorities = array(
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(
array(
'status' => $status,
'date_compare' => '<=',
),
$args
);
yield wp_parse_args(
array(
'status' => $status,
'date_compare' => '>=',
),
$args
);
}
}