ActionScheduler_Abstract_Schema::tables_exist()publicWC 1.0

Confirms that all of the tables registered by this schema class have been created.

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

Хуков нет.

Возвращает

true|false.

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

$ActionScheduler_Abstract_Schema = new ActionScheduler_Abstract_Schema();
$ActionScheduler_Abstract_Schema->tables_exist();

Код ActionScheduler_Abstract_Schema::tables_exist() WC 7.1.0

public function tables_exist() {
	global $wpdb;

	$existing_tables = $wpdb->get_col( 'SHOW TABLES' );
	$expected_tables = array_map(
		function ( $table_name ) use ( $wpdb ) {
			return $wpdb->prefix . $table_name;
		},
		$this->tables
	);

	return count( array_intersect( $existing_tables, $expected_tables ) ) === count( $expected_tables );
}