WordPress at a glance
function is not described

Automattic\WooCommerce\Admin\API\Reports\Orders

DataStore::map_array_by_key() protected WC 1.0

Returns the same array index by a given key

{} 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->map_array_by_key( $array, $key );
$array(array) (required)
Array to be looped over.
$key(string) (required)
Key of values used for new array.

Code of DataStore::map_array_by_key() WC 5.3.0

<?php
protected function map_array_by_key( $array, $key ) {
	$mapped = array();
	foreach ( $array as $item ) {
		$mapped[ $item[ $key ] ] = $item;
	}
	return $mapped;
}