WordPress at a glance
function is not described

Automattic\WooCommerce\Admin

CategoryLookup::update() protected WC 1.0

Updates lookup table data for a category by ID.

{} It's a method of the class: CategoryLookup{}

No Hooks.

Return

null. Nothing.

Usage

// protected - for code of main (parent) or child class
$result = $this->update( $category_id );
$category_id(int) (required)
Category ID to update.

Code of CategoryLookup::update() WC 5.2.2

<?php
protected function update( $category_id ) {
	global $wpdb;

	$ancestors = get_ancestors( $category_id, 'product_cat', 'taxonomy' );
	$children  = get_term_children( $category_id, 'product_cat' );
	$inserts   = array();
	$inserts[] = $this->get_insert_sql( $category_id, $category_id );

	foreach ( $ancestors as $ancestor ) {
		$inserts[] = $this->get_insert_sql( $category_id, $ancestor );

		foreach ( $children as $child ) {
			$inserts[] = $this->get_insert_sql( $child->category_id, $ancestor );
		}
	}

	$insert_string = implode( ',', $inserts );

	$wpdb->query( "INSERT IGNORE INTO $wpdb->wc_category_lookup (category_id, category_tree_id) VALUES {$insert_string}" ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.PreparedSQL.InterpolatedNotPrepared
}