Automattic\WooCommerce\Internal\Utilities

DatabaseUtil::parse_dbdelta_output()publicWC 1.0

Parses the output given by dbdelta and returns information about it.

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

Хуков нет.

Возвращает

Массив[]. An array containing a 'created_tables' key whose value is an array with the names of the tables that have been (or would have been) created.

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

$DatabaseUtil = new DatabaseUtil();
$DatabaseUtil->parse_dbdelta_output( $dbdelta_output ): array;
$dbdelta_output(массив) (обязательный)
The output from the execution of dbdelta.

Код DatabaseUtil::parse_dbdelta_output() WC 6.6.1

public function parse_dbdelta_output( array $dbdelta_output ): array {
	$created_tables = array();

	foreach ( $dbdelta_output as $table_name => $result ) {
		if ( "Created table $table_name" === $result ) {
			$created_tables[] = $table_name;
		}
	}

	return array( 'created_tables' => $created_tables );
}