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{}

Хуков нет.


Массив. An array containing the names of the tables that currently don't exist in the database.


$DatabaseUtil = new DatabaseUtil();
$DatabaseUtil->get_missing_tables( $creation_queries ): array;
$creation_queries(строка) (обязательный)
The SQL queries to execute ("CREATE TABLE" statements, same format as for dbDelta).

Код DatabaseUtil::get_missing_tables() WC 7.3.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'];