Automattic\WooCommerce\Internal\ProductAttributesLookup

LookupDataStore::lookup_table_has_data()publicWC 1.0

Check if the lookup table contains any entry at all.

Method of the class: LookupDataStore{}

No Hooks.

Return

true|false. True if the table contains entries, false if the table is empty.

Usage

$LookupDataStore = new LookupDataStore();
$LookupDataStore->lookup_table_has_data(): bool;

LookupDataStore::lookup_table_has_data() code WC 7.1.1

public function lookup_table_has_data(): bool {
	global $wpdb;

	// phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared
	return ( (int) $wpdb->get_var( "SELECT EXISTS (SELECT 1 FROM {$this->lookup_table_name})" ) ) !== 0;
}