Automattic\WooCommerce\Internal\Admin\Schedulers
OrdersScheduler::has_order_stats_row
Check whether an order or refund already has a row in the order stats table.
Method of the class: OrdersScheduler{}
No Hooks.
Returns
bool.
Usage
$result = OrdersScheduler::has_order_stats_row( $order_id ): bool;
- $order_id(int) (required)
- Order or refund ID.
OrdersScheduler::has_order_stats_row() OrdersScheduler::has order stats row code WC 11.1.2
private static function has_order_stats_row( $order_id ): bool {
global $wpdb;
$table_name = OrdersStatsDataStore::get_db_table_name();
// phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared
return (bool) $wpdb->get_var( $wpdb->prepare( "SELECT order_id FROM {$table_name} WHERE order_id = %d LIMIT 1", $order_id ) );
}