WordPress at a glance
function is not described

Automattic\WooCommerce\Admin\API\Reports\Stock

Controller::get_products() protected WC 1.0

Query products.

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

No Hooks.

Return

Array. Nothing.

Usage

// protected - for code of main (parent) or child class
$result = $this->get_products( $query_args );
$query_args(array) (required)
Query args.

Code of Controller::get_products() WC 5.3.0

<?php
protected function get_products( $query_args ) {
	$query  = new \WP_Query();
	$result = $query->query( $query_args );

	$total_posts = $query->found_posts;
	if ( $total_posts < 1 ) {
		// Out-of-bounds, run the query again without LIMIT for total count.
		unset( $query_args['paged'] );
		$count_query = new \WP_Query();
		$count_query->query( $query_args );
		$total_posts = $count_query->found_posts;
	}

	return array(
		'objects' => array_map( 'wc_get_product', $result ),
		'total'   => (int) $total_posts,
		'pages'   => (int) ceil( $total_posts / (int) $query->query_vars['posts_per_page'] ),
	);
}