Automattic\WooCommerce\Internal\DataStores\Orders

LegacyDataHandler::get_orders_for_cleanup()publicWC 1.0

Returns a set of orders for which legacy post data can be removed.

Метод класса: LegacyDataHandler{}

Хуков нет.

Возвращает

Массив[int]. Order IDs.

Использование

$LegacyDataHandler = new LegacyDataHandler();
$LegacyDataHandler->get_orders_for_cleanup( $order_ids, $limit ): array;
$order_ids(массив)
If provided, result is a subset of the order IDs in this array, which can contain either individual order IDs or ranges like "100-200".
По умолчанию: array()
$limit(int)
Limit the number of results.

Код LegacyDataHandler::get_orders_for_cleanup() WC 9.7.1

public function get_orders_for_cleanup( $order_ids = array(), int $limit = 0 ): array {
	global $wpdb;

	return array_map(
		'absint',
		$wpdb->get_col( $this->build_sql_query_for_cleanup( $order_ids, 'ids', $limit ) ) // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared -- prepared in build_sql_query_for_cleanup().
	);
}