Automattic\WooCommerce\Internal\ProductAttributesLookup
DataRegenerator::check_can_do_lookup_table_regeneration()
Check if everything is good to go to perform a complete or per product lookup table data regeneration and throw an exception if not.
Метод класса: DataRegenerator{}
Хуков нет.
Возвращает
null
. Ничего.
Использование
// private - только в коде основоного (родительского) класса $result = $this->check_can_do_lookup_table_regeneration( $product_id );
- $product_id(разное)
- The product id to check the regeneration viability for, or null to check if a complete regeneration is possible.
По умолчанию: null
Код DataRegenerator::check_can_do_lookup_table_regeneration() DataRegenerator::check can do lookup table regeneration WC 7.7.2
private function check_can_do_lookup_table_regeneration( $product_id = null ) { 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" ); } }