items; } public static function get() { if(!self::created()) { $_SESSION["inventory"] = new Inventory(); } return $_SESSION["inventory"]; } private function _addItem($item) { $counter = 0; foreach($this->items as $object){ if($object[0] == $item){ $counter++; } } $tab = array($item,$counter+1); $this->items[] = $tab; return $tab; } public static function addItem($item) { $inv = self::get(); $tab = $inv->_addItem($item); return $tab; } private function _removeItem($item) { unset($this->items[array_search($item, $this->items)]); } public static function removeItem($item) { $inv = self::get(); $inv->_removeItem($item); } } ?>