Automattic\WooCommerce\Internal\Admin\Schedulers
OrdersScheduler::get_orders_since
Get orders updated since the specified cursor position.
Uses a compound cursor (date + ID) to handle cases where multiple orders have the same timestamp. This ensures we can paginate through orders reliably even when batch_size < number of orders at the same timestamp.
Method of the class: OrdersScheduler{}
No Hooks.
Returns
Array. Array of objects with 'id' and 'date_updated_gmt' properties.
Usage
$result = OrdersScheduler::get_orders_since( $cursor_date, $cursor_id, $limit );
- $cursor_date(string) (required)
- Cursor date in
'Y-m-d H:i:s'format. - $cursor_id(int) (required)
- Cursor order ID.
- $limit(int) (required)
- Number of orders to retrieve.
OrdersScheduler::get_orders_since() OrdersScheduler::get orders since code WC 10.8.1
private static function get_orders_since( $cursor_date, $cursor_id, $limit ) {
if ( OrderUtil::custom_orders_table_usage_is_enabled() ) {
return self::get_orders_since_from_orders_table( $cursor_date, $cursor_id, $limit );
} else {
return self::get_orders_since_from_posts_table( $cursor_date, $cursor_id, $limit );
}
}