18 private static $poolList = array();
19 private $typeList = array();
28 if (!isset(static::$poolList[$key]))
31 static::$poolList[$key] = $pool;
34 return static::$poolList[$key];
43 public function get($type, $code)
46 return $pool->get($code);
58 return $pool->getByStore($code, $storeId);
69 if (empty($this->typeList[$type]))
71 $this->typeList[$type] =
new Pool();
74 return $this->typeList[$type];
82 public function getQuantities($type)
86 return $pool->getQuantities();
97 return $pool->getQuantitiesWithStore();
105 public function add($type, $code, $value)
108 $currentValue = floatval($pool->get($code));
109 $pool->set($code, $currentValue + $value);
120 $currentValue = floatval($pool->getByStore($code, $storeId));
121 $pool->setByStore($code, $storeId, $currentValue + $value);
129 public function set($type, $code, $value)
132 $pool->set($code, $value);
143 $pool->setByStore($code, $storeId, $value);
150 public function delete($type, $code)
153 $pool->delete($code);
162 $list = $pool->getQuantities();
164 foreach($list as $itemKey => $itemValue)
166 $pool->delete($itemKey);
getByStore($type, $code, $storeId)
getQuantitiesWithStore($type)
add($type, $code, $value)
setByStore($type, $code, $storeId, $value)
addByStore($type, $code, $storeId, $value)