<?php
/**
* Report table sync related functions and actions.
*/
namespace Automattic\WooCommerce\Admin;
defined( 'ABSPATH' ) || exit;
use Automattic\WooCommerce\Internal\Admin\Schedulers\CustomersScheduler;
use Automattic\WooCommerce\Internal\Admin\Schedulers\OrdersScheduler;
use Automattic\WooCommerce\Internal\Admin\Schedulers\ImportScheduler;
/**
* ReportsSync Class.
*/
class ReportsSync {
/**
* Hook in sync methods.
*/
public static function init() {
// Initialize scheduler hooks.
foreach ( self::get_schedulers() as $scheduler ) {
$scheduler::init();
}
add_action( 'woocommerce_update_product', array( __CLASS__, 'clear_stock_count_cache' ) );
add_action( 'woocommerce_new_product', array( __CLASS__, 'clear_stock_count_cache' ) );
add_action( 'update_option_woocommerce_notify_low_stock_amount', array( __CLASS__, 'clear_stock_count_cache' ) );
add_action( 'update_option_woocommerce_notify_no_stock_amount', array( __CLASS__, 'clear_stock_count_cache' ) );
}
/**
* Get classes for syncing data.
*
* @return array
* @throws \Exception Throws exception when invalid data is found.
*/
public static function get_schedulers() {
$schedulers = apply_filters(
'woocommerce_analytics_report_schedulers',
array(
new CustomersScheduler(),
new OrdersScheduler(),
)
);
 
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX