Automattic\WooCommerce\Internal\Utilities
DatabaseUtil::parse_dbdelta_output()
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() DatabaseUtil::parse dbdelta output WC 9.8.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[] = str_replace( '(', '', $table_name ); } } return array( 'created_tables' => $created_tables ); }