// Stock : getStockId() copied in this new Class untill its implementation is done

This commit is contained in:
bMancone
2011-10-10 10:05:43 +00:00
parent 29629d1af1
commit 149c814a45
+14
View File
@@ -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);
}
}