Automattic\WooCommerce\Internal\Utilities

DatabaseUtil::get_missing_tables()publicWC 1.0

Given a set of table creation SQL statements, check which of the tables are currently missing in the database.

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

No Hooks.

Return

Array. An array containing the names of the tables that currently don't exist in the database.

Usage

$DatabaseUtil = new DatabaseUtil();
$DatabaseUtil->get_missing_tables( $creation_queries ): array;
$creation_queries(string) (required)
The SQL queries to execute ("CREATE TABLE" statements, same format as for dbDelta).

Code of DatabaseUtil::get_missing_tables() WC 7.1.0

public function get_missing_tables( string $creation_queries ): array {
	$dbdelta_output = $this->dbdelta( $creation_queries, false );
	$parsed_output  = $this->parse_dbdelta_output( $dbdelta_output );
	return $parsed_output['created_tables'];
}