/**
  * WARNING: For testing only. Do NOT rely on this method, it may be removed at any time.
  * @todo Delegate static calls from Configuration to an instance
  * of a class to be created.
  */
 public static function clearConfigurationCacheForTesting()
 {
     self::$_cache = array();
 }
Exemple #2
0
 /**
  * Delete configuration key from current context.
  *
  * @param string $key
  */
 public static function deleteFromContext($key)
 {
     if (Shop::getContext() == Shop::CONTEXT_ALL) {
         return;
     }
     $idShop = null;
     $idShopGroup = Shop::getContextShopGroupID(true);
     if (Shop::getContext() == Shop::CONTEXT_SHOP) {
         $idShop = Shop::getContextShopID(true);
     }
     $id = Configuration::getIdByName($key, $idShopGroup, $idShop);
     Db::getInstance()->execute('
     DELETE FROM `' . _DB_PREFIX_ . bqSQL(self::$definition['table']) . '`
     WHERE `' . bqSQL(self::$definition['primary']) . '` = ' . (int) $id);
     Db::getInstance()->execute('
     DELETE FROM `' . _DB_PREFIX_ . bqSQL(self::$definition['table']) . '_lang`
     WHERE `' . bqSQL(self::$definition['primary']) . '` = ' . (int) $id);
     self::$_cache = null;
     self::$_new_cache_shop = null;
     self::$_new_cache_group = null;
     self::$_new_cache_global = null;
     self::$_initialized = false;
 }