Automattic\WooCommerce\Internal\ProductAttributesLookup
CLIRunner::get_lookup_table_info()
Get information about the product attributes lookup table.
Метод класса: CLIRunner{}
Хуков нет.
Возвращает
Массив
. Array containing the 'total_rows' and 'products_count' keys.
Использование
// private - только в коде основоного (родительского) класса $result = $this->get_lookup_table_info(): array;
Код CLIRunner::get_lookup_table_info() CLIRunner::get lookup table info WC 9.7.1
private function get_lookup_table_info(): array { global $wpdb; $table_name = $this->lookup_data_store->get_lookup_table_name(); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared $info = $wpdb->get_row( 'select count(1), count(distinct(product_or_parent_id)) from ' . $table_name, ARRAY_N ); return array( 'total_rows' => absint( $info[0] ), 'products_count' => absint( $info[1] ), ); }