// Context part 20

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@7740 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
tDidierjean
2011-07-26 15:55:04 +00:00
parent fddc7a6a75
commit 51b4c8591d
10 changed files with 72 additions and 73 deletions
+4 -4
View File
@@ -2060,10 +2060,10 @@ class ProductCore extends ObjectModel
* @param Context $context
* @return string
*/
public static function sqlStock($productAlias, $productAttribute = 0, $innerJoin = false, Context $context = null)
public static function sqlStock($productAlias, $productAttribute = 0, $innerJoin = false, Shop $shop = null)
{
if (!$context)
$context = Context::getContext();
if (!$shop)
$shop = Context::getContext()->shop;
$sql = (($innerJoin) ? ' INNER ' : ' LEFT ').'JOIN '._DB_PREFIX_.'stock stock ON stock.id_product = '.pSQL($productAlias).'.id_product';
if (!is_null($productAttribute))
@@ -2073,7 +2073,7 @@ class ProductCore extends ObjectModel
else if (is_string($productAttribute))
$sql .= ' AND stock.id_product_attribute = IFNULL('.pSQL($productAttribute).'.id_product_attribute, 0)';
}
$sql .= $context->shop->sqlSharedStock('stock') . ' ';
$sql .= $shop->sqlSharedStock('stock') . ' ';
return $sql;
}