Automattic\WooCommerce\Internal\Logging

OrderLogsCleanupHelper::initpublicWC 1.0

Initialize the instance. This is invoked by the dependency injection container.

Method of the class: OrderLogsCleanupHelper{}

No Hooks.

Returns

null. Nothing (null).

Usage

$OrderLogsCleanupHelper = new OrderLogsCleanupHelper();
$OrderLogsCleanupHelper->init( $hpos_controller, $data_synchronizer ): void;
$hpos_controller(CustomOrdersTableController) (required)
The instance of CustomOrdersTableController to use.
$data_synchronizer(DataSynchronizer) (required)
The instance of DataSynchronizer to use.

OrderLogsCleanupHelper::init() code WC 10.8.1

final public function init( CustomOrdersTableController $hpos_controller, DataSynchronizer $data_synchronizer ): void {
	$this->hpos_in_use = $hpos_controller->custom_orders_table_usage_is_enabled();
	if ( ! $this->hpos_in_use ) {
		$this->cpt_in_use = \WC_Order_Data_Store_CPT::class === \WC_Data_Store::load( 'order' )->get_current_class_name();
	}

	$this->data_synchronizer = $data_synchronizer;
}