// Improve collections : where() method reworked (prototype changed) + validation of fields
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -264,7 +264,7 @@ class SupplyOrderCore extends ObjectModel
|
||||
public function getEntriesCollection()
|
||||
{
|
||||
$details = new Collection('SupplyOrderDetail');
|
||||
$details->where('a.id_supply_order = '.(int)$this->id);
|
||||
$details->where('id_supply_order', '=', $this->id);
|
||||
return $details;
|
||||
}
|
||||
|
||||
|
||||
@@ -117,7 +117,7 @@ class WarehouseProductLocationCore extends ObjectModel
|
||||
public static function getCollection($id_product)
|
||||
{
|
||||
$collection = new Collection('WarehouseProductLocation');
|
||||
$collection->where('a.id_product = '.(int)$id_product);
|
||||
$collection->where('id_product', '=', $id_product);
|
||||
return $collection;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user