From 6e46649631bef7e91691b7679416c96a1adc3897 Mon Sep 17 00:00:00 2001 From: rMalie Date: Tue, 9 Aug 2011 14:50:30 +0000 Subject: [PATCH] // Add cache on products stock git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@7965 b9a71923-0436-4b27-9f14-aed3839534dd --- classes/Product.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/classes/Product.php b/classes/Product.php index 94d9c828f..1f34ff209 100644 --- a/classes/Product.php +++ b/classes/Product.php @@ -204,7 +204,7 @@ class ProductCore extends ObjectModel protected static $producPropertiesCache = array(); /** @var array cache stock data in getStock() method */ - protected $cacheStock = array(); + protected static $cacheStock = array(); /** @var array tables */ protected $tables = array ('product', 'product_lang'); @@ -2086,8 +2086,8 @@ class ProductCore extends ObjectModel 'id_group_shop' => $shop->getGroupID(), 'quantity' => $quantity, ), 'INSERT'); - - $this->cacheStock[$id_product_attribute] = null; + + self::$cacheStock[$this->id][$id_product_attribute] = null; } /** @@ -2105,7 +2105,7 @@ class ProductCore extends ObjectModel if (!$context) $context = Context::getContext(); - if (!isset($this->cacheStock[$id_product_attribute])) + if (!isset(self::$cacheStock[$this->id][$id_product_attribute])) { $sql = 'SELECT quantity FROM '._DB_PREFIX_.'stock