当前位置: 首页>>代码示例>>PHP>>正文


PHP Customization::isCurrentlyUsed方法代码示例

本文整理汇总了PHP中Customization::isCurrentlyUsed方法的典型用法代码示例。如果您正苦于以下问题:PHP Customization::isCurrentlyUsed方法的具体用法?PHP Customization::isCurrentlyUsed怎么用?PHP Customization::isCurrentlyUsed使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Customization的用法示例。


在下文中一共展示了Customization::isCurrentlyUsed方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: _deleteOldLabels

    protected function _deleteOldLabels()
    {
        $max = array(Product::CUSTOMIZE_FILE => (int) Tools::getValue('uploadable_files'), Product::CUSTOMIZE_TEXTFIELD => (int) Tools::getValue('text_fields'));
        /* Get customization field ids */
        if (($result = Db::getInstance()->executeS('SELECT `id_customization_field`, `type`
			FROM `' . _DB_PREFIX_ . 'customization_field`
			WHERE `id_product` = ' . (int) $this->id . '
			ORDER BY `id_customization_field`')) === false) {
            return false;
        }
        if (empty($result)) {
            return true;
        }
        $customization_fields = array(Product::CUSTOMIZE_FILE => array(), Product::CUSTOMIZE_TEXTFIELD => array());
        foreach ($result as $row) {
            $customization_fields[(int) $row['type']][] = (int) $row['id_customization_field'];
        }
        $extra_file = count($customization_fields[Product::CUSTOMIZE_FILE]) - $max[Product::CUSTOMIZE_FILE];
        $extra_text = count($customization_fields[Product::CUSTOMIZE_TEXTFIELD]) - $max[Product::CUSTOMIZE_TEXTFIELD];
        /* If too much inside the database, deletion */
        if ($extra_file > 0 && count($customization_fields[Product::CUSTOMIZE_FILE]) - $extra_file >= 0 && (!Db::getInstance()->execute('DELETE FROM `' . _DB_PREFIX_ . 'customization_field`
			WHERE `id_product` = ' . (int) $this->id . '
			AND `type` = ' . Product::CUSTOMIZE_FILE . '
			AND `id_customization_field` >= ' . (int) $customization_fields[Product::CUSTOMIZE_FILE][count($customization_fields[Product::CUSTOMIZE_FILE]) - $extra_file]) || !Db::getInstance()->execute('DELETE FROM `' . _DB_PREFIX_ . 'customization_field_lang`
			WHERE `id_customization_field`
			NOT IN (
				SELECT `id_customization_field`
				FROM `' . _DB_PREFIX_ . 'customization_field`
			)'))) {
            return false;
        }
        if ($extra_text > 0 && count($customization_fields[Product::CUSTOMIZE_TEXTFIELD]) - $extra_text >= 0 && (!Db::getInstance()->execute('DELETE FROM `' . _DB_PREFIX_ . 'customization_field`
			WHERE `id_product` = ' . (int) $this->id . '
			AND `type` = ' . Product::CUSTOMIZE_TEXTFIELD . '
			AND `id_customization_field` >= ' . (int) $customization_fields[Product::CUSTOMIZE_TEXTFIELD][count($customization_fields[Product::CUSTOMIZE_TEXTFIELD]) - $extra_text]) || !Db::getInstance()->execute('DELETE FROM `' . _DB_PREFIX_ . 'customization_field_lang`
			WHERE `id_customization_field`
			NOT IN (
				SELECT `id_customization_field`
				FROM `' . _DB_PREFIX_ . 'customization_field`
			)'))) {
            return false;
        }
        // Refresh cache of feature detachable
        Configuration::updateGlobalValue('PS_CUSTOMIZATION_FEATURE_ACTIVE', Customization::isCurrentlyUsed());
        return true;
    }
开发者ID:jicheng17,项目名称:vipinsg,代码行数:46,代码来源:Product.php


注:本文中的Customization::isCurrentlyUsed方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。