public static function getIdByName($key, $id_shop_group = null, $id_shop = null)
 {
     ConfigurationKPI::setKpiDefinition();
     $r = parent::getIdByName($key, $id_shop_group, $id_shop);
     ConfigurationKPI::unsetKpiDefinition();
     return $r;
 }
Example #2
0
    /**
     * Delete configuration key from current context.
     *
     * @param string $key
     */
    public static function deleteFromContext($key)
    {
        if (Shop::getContext() == Shop::CONTEXT_ALL) {
            return;
        }
        $id_shop = null;
        $id_shop_group = Shop::getContextShopGroupID(true);
        if (Shop::getContext() == Shop::CONTEXT_SHOP) {
            $id_shop = Shop::getContextShopID(true);
        }
        $id = Configuration::getIdByName($key, $id_shop_group, $id_shop);
        Db::getInstance()->execute('
		DELETE FROM ' . _DB_PREFIX_ . 'configuration
		WHERE id_configuration = ' . (int) $id);
        Db::getInstance()->execute('
		DELETE FROM ' . _DB_PREFIX_ . 'configuration_lang
		WHERE id_configuration = ' . (int) $id);
        self::$_CONF = null;
    }
Example #3
0
    /**
     * Delete configuration key from current context.
     *
     * @param string $key
     */
    public static function deleteFromContext($key)
    {
        if (Shop::getContext() == Shop::CONTEXT_ALL) {
            return;
        }
        $id_shop = null;
        $id_shop_group = Shop::getContextShopGroupID(true);
        if (Shop::getContext() == Shop::CONTEXT_SHOP) {
            $id_shop = Shop::getContextShopID(true);
        }
        $id = Configuration::getIdByName($key, $id_shop_group, $id_shop);
        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[self::$definition['table']] = null;
    }