public static function updateGood($id, $values) { if (is_array($values)) { $goodsType = new DBGoodsType(); if (array_key_exists(DB::TABLE_GOODS__ID, $values)) { unset($values[DB::TABLE_GOODS__ID]); } $pref = new DBPreferencesType(); $imagePath = $pref->getPreference(Constants::CATALOG_PATH); $imagePath = $imagePath[DB::TABLE_PREFERENCES__VALUE]; $imagesCatalog = $values[DB::TABLE_GOODS__KEY_ITEM]; $isDirCreated = FileUtils::createDir($imagePath . $imagesCatalog); return $goodsType->update($id, $values); } return -1; }