Automattic\WooCommerce\Internal\DataStores\Orders
DataSynchronizer::check_orders_table_exists
Does the custom orders tables exist in the database?
Method of the class: DataSynchronizer{}
No Hooks.
Returns
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() DataSynchronizer::check orders table exists code WC 10.3.6
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;
}
}