Automattic\WooCommerce\Internal\DataStores\Orders

DataSynchronizer::check_orders_table_exists()publicWC 1.0

Does the custom orders tables exist in the database?

Method of the class: DataSynchronizer{}

No Hooks.

Return

true|false. True if the custom orders tables exist in the database.

Usage

$DataSynchronizer = new DataSynchronizer();
$DataSynchronizer->check_orders_table_exists(): bool;

DataSynchronizer::check_orders_table_exists() code WC 8.6.1

public function check_orders_table_exists(): bool {
	$missing_tables = $this->database_util->get_missing_tables( $this->data_store->get_database_schema() );

	if ( count( $missing_tables ) === 0 ) {
		update_option( self::ORDERS_TABLE_CREATED, 'yes' );
		return true;
	} else {
		update_option( self::ORDERS_TABLE_CREATED, 'no' );
		return false;
	}
}