Automattic\WooCommerce\StoreApi\Utilities

ProductQuery::get_objects()publicWC 1.0

Get objects.

Method of the class: ProductQuery{}

No Hooks.

Return

Array.

Usage

$ProductQuery = new ProductQuery();
$ProductQuery->get_objects( $request );
$request(\WP_REST_Request) (required)
Request data.

ProductQuery::get_objects() code WC 8.7.0

public function get_objects( $request ) {
	$results = $this->get_results( $request );

	return [
		'objects' => array_map( 'wc_get_product', $results['results'] ),
		'total'   => $results['total'],
		'pages'   => $results['pages'],
	];
}