Automattic\WooCommerce\Internal\ProductAttributesLookup
DataRegenerator::initialize_table_and_data()
Create the lookup table and initialize the options that will be temporarily used while the regeneration is in progress.
Метод класса: DataRegenerator{}
Хуков нет.
Возвращает
int
. Id of the last product id that will be processed.
Использование
// private - только в коде основоного (родительского) класса $result = $this->initialize_table_and_data(): int;
Код DataRegenerator::initialize_table_and_data() DataRegenerator::initialize table and data WC 9.7.1
private function initialize_table_and_data(): int { $database_util = wc_get_container()->get( DatabaseUtil::class ); $database_util->dbdelta( $this->get_table_creation_sql() ); $last_existing_product_id = $this->get_last_existing_product_id(); if ( ! $last_existing_product_id ) { // No products exist, nothing to (re)generate. return 0; } update_option( 'woocommerce_attribute_lookup_last_product_id_to_process', $last_existing_product_id ); update_option( 'woocommerce_attribute_lookup_processed_count', 0 ); return $last_existing_product_id; }