本文整理汇总了PHP中CartRule::cleanProductRuleIntegrity方法的典型用法代码示例。如果您正苦于以下问题:PHP CartRule::cleanProductRuleIntegrity方法的具体用法?PHP CartRule::cleanProductRuleIntegrity怎么用?PHP CartRule::cleanProductRuleIntegrity使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CartRule
的用法示例。
在下文中一共展示了CartRule::cleanProductRuleIntegrity方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: delete
public function delete()
{
if (!$this->hasMultishopEntries() || Shop::getContext() == Shop::CONTEXT_ALL) {
$result = Db::getInstance()->executeS('SELECT id_product_attribute FROM ' . _DB_PREFIX_ . 'product_attribute_combination WHERE id_attribute = ' . (int) $this->id);
$products = array();
foreach ($result as $row) {
$combination = new Combination($row['id_product_attribute']);
$new_request = Db::getInstance()->executeS('SELECT id_product, default_on FROM ' . _DB_PREFIX_ . 'product_attribute WHERE id_product_attribute = ' . (int) $row['id_product_attribute']);
foreach ($new_request as $value) {
if ($value['default_on'] == 1) {
$products[] = $value['id_product'];
}
}
$combination->delete();
}
foreach ($products as $product) {
$result = Db::getInstance()->executeS('SELECT id_product_attribute FROM ' . _DB_PREFIX_ . 'product_attribute WHERE id_product = ' . (int) $product . ' LIMIT 1');
foreach ($result as $row) {
if (Validate::isLoadedObject($product = new Product((int) $product))) {
$product->deleteDefaultAttributes();
$product->setDefaultAttribute($row['id_product_attribute']);
}
}
}
// Delete associated restrictions on cart rules
CartRule::cleanProductRuleIntegrity('attributes', $this->id);
/* Reinitializing position */
$this->cleanPositions((int) $this->id_attribute_group);
}
$return = parent::delete();
if ($return) {
Hook::exec('actionAttributeDelete', array('id_attribute' => $this->id));
}
return $return;
}
示例2: delete
public function delete()
{
$address = new Address($this->id_address);
if (Validate::isLoadedObject($address) and !$address->delete()) {
return false;
}
if (parent::delete()) {
CartRule::cleanProductRuleIntegrity('manufacturers', $this->id);
return $this->deleteImage();
}
}
示例3: delete
public function delete()
{
if (!$this->hasMultishopEntries()) {
$result = Db::getInstance()->executeS('SELECT id_product_attribute FROM ' . _DB_PREFIX_ . 'product_attribute_combination WHERE id_attribute = ' . (int) $this->id);
foreach ($result as $row) {
$combination = new Combination($row['id_product_attribute']);
$combination->delete();
}
// Delete associated restrictions on cart rules
CartRule::cleanProductRuleIntegrity('attributes', $this->id);
/* Reinitializing position */
$this->cleanPositions((int) $this->id_attribute_group);
}
$return = parent::delete();
if ($return) {
Hook::exec('actionAttributeDelete', array('id_attribute' => $this->id));
}
return $return;
}
示例4: delete
/**
* @see ObjectModel::delete()
*/
public function delete()
{
if (parent::delete()) {
CartRule::cleanProductRuleIntegrity('suppliers', $this->id);
return $this->deleteImage();
}
}
示例5: delete
public function delete()
{
if ((int) $this->id === 0 || (int) $this->id === (int) Configuration::get('PS_ROOT_CATEGORY')) {
return false;
}
$this->clearCache();
$deleted_children = $all_cat = $this->getAllChildren();
$all_cat[] = $this;
foreach ($all_cat as $cat) {
/** @var Category $cat */
$cat->deleteLite();
if (!$this->hasMultishopEntries()) {
$cat->deleteImage();
$cat->cleanGroups();
$cat->cleanAssoProducts();
// Delete associated restrictions on cart rules
CartRule::cleanProductRuleIntegrity('categories', array($cat->id));
Category::cleanPositions($cat->id_parent);
/* Delete Categories in GroupReduction */
if (GroupReduction::getGroupsReductionByCategoryId((int) $cat->id)) {
GroupReduction::deleteCategory($cat->id);
}
}
}
/* Rebuild the nested tree */
if (!$this->hasMultishopEntries() && (!isset($this->doNotRegenerateNTree) || !$this->doNotRegenerateNTree)) {
Category::regenerateEntireNtree();
}
Hook::exec('actionCategoryDelete', array('category' => $this, 'deleted_children' => $deleted_children));
return true;
}
示例6: deleteFromCartRules
public function deleteFromCartRules()
{
CartRule::cleanProductRuleIntegrity('products', $this->id);
return true;
}