WordPress at Your Fingertips
function is not described

Automattic\WooCommerce\Internal\ProductAttributesLookup

DataRegenerator::check_can_do_lookup_table_regeneration() private WC 1.0

Check if everything is good to go to perform a complete or per product lookup table data regeneration and throw an exception if not.

{} It's a method of the class: DataRegenerator{}

No Hooks.

Return

null. Nothing.

Usage

// private - for code of main (parent) class only
$result = $this->check_can_do_lookup_table_regeneration( $product_id );
$product_id(mixed)
The product id to check the regeneration viability for, or null to check if a complete regeneration is possible.
Default: null

Code of DataRegenerator::check_can_do_lookup_table_regeneration() WC 5.9.0

private function check_can_do_lookup_table_regeneration( $product_id = null ) {
	if ( ! $this->data_store->is_feature_visible() ) {
		throw new \Exception( "Can't do product attribute lookup data regeneration: feature is not visible" );
	}
	if ( $product_id && ! $this->data_store->check_lookup_table_exists() ) {
		throw new \Exception( "Can't do product attribute lookup data regeneration: lookup table doesn't exist" );
	}
	if ( $this->data_store->regeneration_is_in_progress() ) {
		throw new \Exception( "Can't do product attribute lookup data regeneration: regeneration is already in progress" );
	}
	if ( $product_id && ! wc_get_product( $product_id ) ) {
		throw new \Exception( "Can't do product attribute lookup data regeneration: product doesn't exist" );
	}
}