Automattic\WooCommerce\Internal\CLI\Migrator\Platforms\Shopify
ShopifyFetcher::build_count_query_params
Build query parameters for the count API request.
Method of the class: ShopifyFetcher{}
No Hooks.
Returns
Array. Query parameters for the REST API.
Usage
// private - for code of main (parent) class only $result = $this->build_count_query_params( $args ): array;
- $args(array) (required)
- Filter arguments.
ShopifyFetcher::build_count_query_params() ShopifyFetcher::build count query params code WC 10.7.0
private function build_count_query_params( array $args ): array {
$query_params = array();
// Map standard filter args to Shopify REST count query params.
if ( isset( $args['status'] ) ) {
$query_params['status'] = strtolower( $args['status'] ); // REST uses lowercase.
}
if ( isset( $args['created_at_min'] ) ) {
$query_params['created_at_min'] = $args['created_at_min'];
}
if ( isset( $args['created_at_max'] ) ) {
$query_params['created_at_max'] = $args['created_at_max'];
}
if ( isset( $args['updated_at_min'] ) ) {
$query_params['updated_at_min'] = $args['updated_at_min'];
}
if ( isset( $args['updated_at_max'] ) ) {
$query_params['updated_at_max'] = $args['updated_at_max'];
}
if ( isset( $args['vendor'] ) ) {
$query_params['vendor'] = $args['vendor'];
}
if ( isset( $args['product_type'] ) ) {
$query_params['product_type'] = $args['product_type'];
}
return $query_params;
}