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 8.7.0

public function tables_exist() {
	global $wpdb;

	$tables_exist = true;

	foreach ( $this->tables as $table_name ) {
		$table_name     = $wpdb->prefix . $table_name;
		$pattern        = str_replace( '_', '\\_', $table_name );
		$existing_table = $wpdb->get_var( $wpdb->prepare( 'SHOW TABLES LIKE %s', $pattern ) );

		if ( $existing_table !== $table_name ) {
			$tables_exist = false;
			break;
		}
	}

	return $tables_exist;
}