Remove get_query_for_stock as it's part of data-store

This commit is contained in:
Mike Jolley 2020-02-19 12:46:22 +00:00
parent e965f854d6
commit 107879950e
1 changed files with 0 additions and 20 deletions

View File

@ -151,26 +151,6 @@ final class ReserveStock {
}
}
/**
* Returns query statement for getting current `_stock` of a product.
*
* @todo Once merged to woo core data store, this method can be removed.
* @internal MAX function below is used to make sure result is a scalar.
* @param int $product_id Product ID.
* @return string|void Query statement.
*/
private function get_query_for_stock( $product_id ) {
global $wpdb;
return $wpdb->prepare(
"
SELECT COALESCE ( MAX( meta_value ), 0 ) FROM $wpdb->postmeta as meta_table
WHERE meta_table.meta_key = '_stock'
AND meta_table.post_id = %d
",
$product_id
);
}
/**
* Returns query statement for getting reserved stock of a product.
*