From 251dd966b726f02bcfa7d41513a9dd06ff9080bd Mon Sep 17 00:00:00 2001 From: bMancone Date: Mon, 10 Oct 2011 10:05:43 +0000 Subject: [PATCH] // Stock : getStockId() copied in this new Class untill its implementation is done git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@9177 b9a71923-0436-4b27-9f14-aed3839534dd --- classes/stock/Stock.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/classes/stock/Stock.php b/classes/stock/Stock.php index de5c3a094..bb2642413 100644 --- a/classes/stock/Stock.php +++ b/classes/stock/Stock.php @@ -26,6 +26,7 @@ */ /** + * This represents the physical stock * @since 1.5.0 */ class StockCore extends ObjectModel @@ -71,4 +72,17 @@ class StockCore extends ObjectModel $fields['price_te'] = (float)$this->price_te; return $fields; } + + /** + * @TODO + */ + public static function getStockId($id_product, $id_product_attribute, $id_shop) + { + $sql = 'SELECT id_stock + FROM '._DB_PREFIX_.'stock + WHERE id_product = '.(int)$id_product.' + AND id_product_attribute = '.(int)$id_product_attribute.' + AND id_shop = '.(int)$id_shop; + return (int)Db::getInstance()->getValue($sql); + } } \ No newline at end of file