Automattic\WooCommerce\Internal\ProductAttributesLookup

CLIRunner::initiate_regeneration_core()privateWC 1.0

Core method for the "initiate_regeneration" command.

Метод класса: CLIRunner{}

Хуков нет.

Возвращает

null. Ничего (null).

Использование

// private - только в коде основоного (родительского) класса
$result = $this->initiate_regeneration_core( $args, $assoc_args );
$args(массив) (обязательный)
Positional arguments passed to the command.
$assoc_args(массив) (обязательный)
Associative arguments (options) passed to the command.

Код CLIRunner::initiate_regeneration_core() WC 9.7.1

private function initiate_regeneration_core( array $args, array $assoc_args ) {
	$this->data_regenerator->check_can_do_lookup_table_regeneration();
	$info = $this->get_lookup_table_info();
	if ( $info['total_rows'] > 0 && ! array_key_exists( 'force', $assoc_args ) ) {
		$table_name = $this->lookup_data_store->get_lookup_table_name();
		$this->warning( "The %W{$table_name}%n table contains %C{$info['total_rows']}%n rows corresponding to %G{$info['products_count']}%n products." );
		WP_CLI::confirm( 'Initiating the regeneration will first delete the data. Are you sure?' );
	}

	$this->data_regenerator->initiate_regeneration();
	$table_name = $this->lookup_data_store->get_lookup_table_name();
	$this->log( "%GSuccess:%n The regeneration of the data in the %W{$table_name}%n table has been initiated." );
}