// Improve collections : where() method reworked (prototype changed) + validation of fields

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@11383 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
rMalie
2011-12-19 16:57:28 +00:00
parent 85ed0d2295
commit 1d2f9e44c4
15 changed files with 240 additions and 67 deletions
+4 -3
View File
@@ -620,11 +620,12 @@ class StockManagerCore implements StockManagerInterface
protected function getStockCollection($id_product, $id_product_attribute, $id_warehouse = null, $price_te = null)
{
$stocks = new Collection('Stock');
$stocks->where('a.id_product = '.(int)$id_product.' AND a.id_product_attribute = '.(int)$id_product_attribute);
$stocks->where('id_product', '=', $id_product);
$stocks->where('id_product_attribute', '=', $id_product_attribute);
if ($id_warehouse)
$stocks->where('a.id_warehouse = '.(int)$id_warehouse);
$stocks->where('id_warehouse', '=', $id_warehouse);
if ($price_te)
$stocks->where('a.price_te = '.(float)$price_te);
$stocks->where('price_te', '=', $price_te);
return $stocks;
}