WordPress at a glance
function is not described

Automattic\WooCommerce\Admin\API\Reports

DataStore::get_ids_table() protected WC 1.0

Generates a virtual table given a list of IDs.

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

No Hooks.

Return

Array. Nothing.

Usage

// protected - for code of main (parent) or child class
$result = $this->get_ids_table( $ids, $id_field, $other_values );
$ids(array) (required)
Array of IDs.
$id_field(array) (required)
Name of the ID field.
$other_values(array)
Other values that must be contained in the virtual table.

Code of DataStore::get_ids_table() WC 5.3.0

<?php
protected function get_ids_table( $ids, $id_field, $other_values = array() ) {
	$selects = array();
	foreach ( $ids as $id ) {
		$new_select = "SELECT {$id} AS {$id_field}";
		foreach ( $other_values as $key => $value ) {
			$new_select .= ", {$value} AS {$key}";
		}
		array_push( $selects, $new_select );
	}
	return join( ' UNION ', $selects );
}