當前位置: 首頁>>代碼示例>>PHP>>正文


PHP JModelLegacy::delete方法代碼示例

本文整理匯總了PHP中JModelLegacy::delete方法的典型用法代碼示例。如果您正苦於以下問題:PHP JModelLegacy::delete方法的具體用法?PHP JModelLegacy::delete怎麽用?PHP JModelLegacy::delete使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在JModelLegacy的用法示例。


在下文中一共展示了JModelLegacy::delete方法的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: delete

 public function delete()
 {
     if (!($res = parent::delete())) {
         return false;
     }
     Db::getInstance()->delete('order_detail_tax', 'id_order_detail=' . (int) $this->id);
     return $res;
 }
開發者ID:jeprodev,項目名稱:jeproshop,代碼行數:8,代碼來源:order.php

示例2: delete

 /**
  * @see ObjectModel::delete()
  */
 public function delete()
 {
     if (JeproshopTools::isUnsignedInt($this->customer_id)) {
         JeproshopCustomerModelCustomer::resetAddressCache($this->customer_id);
     }
     if (!$this->isUsed()) {
         return parent::delete();
     } else {
         $this->deleted = true;
         return $this->update();
     }
 }
開發者ID:jeprodev,項目名稱:jeproshop,代碼行數:15,代碼來源:address.php

示例3: delete

    public function delete()
    {
        if (!$this->hasMultishopEntries() || Shop::getContext() == Shop::CONTEXT_ALL) {
            /* Select children in order to find linked combinations */
            $attribute_ids = Db::getInstance()->executeS('
				SELECT `id_attribute`
				FROM `' . _DB_PREFIX_ . 'attribute`
				WHERE `id_attribute_group` = ' . (int) $this->id);
            if ($attribute_ids === false) {
                return false;
            }
            /* Removing attributes to the found combinations */
            $to_remove = array();
            foreach ($attribute_ids as $attribute) {
                $to_remove[] = (int) $attribute['id_attribute'];
            }
            if (!empty($to_remove) && Db::getInstance()->execute('
				DELETE FROM `' . _DB_PREFIX_ . 'product_attribute_combination`
				WHERE `id_attribute`
					IN (' . implode(', ', $to_remove) . ')') === false) {
                return false;
            }
            /* Remove combinations if they do not possess attributes anymore */
            if (!AttributeGroup::cleanDeadCombinations()) {
                return false;
            }
            /* Also delete related attributes */
            if (count($to_remove)) {
                if (!Db::getInstance()->execute('
				DELETE FROM `' . _DB_PREFIX_ . 'attribute_lang`
				WHERE `id_attribute`	IN (' . implode(',', $to_remove) . ')') || !Db::getInstance()->execute('
				DELETE FROM `' . _DB_PREFIX_ . 'attribute_shop`
				WHERE `id_attribute`	IN (' . implode(',', $to_remove) . ')') || !Db::getInstance()->execute('DELETE FROM `' . _DB_PREFIX_ . 'attribute` WHERE `id_attribute_group` = ' . (int) $this->id)) {
                    return false;
                }
            }
            $this->cleanPositions();
        }
        $return = parent::delete();
        if ($return) {
            Hook::exec('actionAttributeGroupDelete', array('id_attribute_group' => $this->id));
        }
        return $return;
    }
開發者ID:jeprodev,項目名稱:jeproshop,代碼行數:44,代碼來源:attribute.php

示例4: delete

 /**
  * @see ObjectModel::delete()
  */
 public function delete()
 {
     if (!parent::delete()) {
         return false;
     }
     Configuration::updateGlobalValue('PS_CART_RULE_FEATURE_ACTIVE', CartRule::isCurrentlyUsed($this->def['table'], true));
     $r = Db::getInstance()->execute('DELETE FROM `' . _DB_PREFIX_ . 'cart_cart_rule` WHERE `id_cart_rule` = ' . (int) $this->id);
     $r &= Db::getInstance()->execute('DELETE FROM `' . _DB_PREFIX_ . 'cart_rule_carrier` WHERE `id_cart_rule` = ' . (int) $this->id);
     $r &= Db::getInstance()->execute('DELETE FROM `' . _DB_PREFIX_ . 'cart_rule_shop` WHERE `id_cart_rule` = ' . (int) $this->id);
     $r &= Db::getInstance()->execute('DELETE FROM `' . _DB_PREFIX_ . 'cart_rule_group` WHERE `id_cart_rule` = ' . (int) $this->id);
     $r &= Db::getInstance()->execute('DELETE FROM `' . _DB_PREFIX_ . 'cart_rule_country` WHERE `id_cart_rule` = ' . (int) $this->id);
     $r &= Db::getInstance()->execute('DELETE FROM `' . _DB_PREFIX_ . 'cart_rule_combination` WHERE `id_cart_rule_1` = ' . (int) $this->id . ' OR `id_cart_rule_2` = ' . (int) $this->id);
     $r &= Db::getInstance()->execute('DELETE FROM `' . _DB_PREFIX_ . 'cart_rule_product_rule_group` WHERE `id_cart_rule` = ' . (int) $this->id);
     $r &= Db::getInstance()->execute('DELETE FROM `' . _DB_PREFIX_ . 'cart_rule_product_rule` WHERE `id_product_rule_group` NOT IN (SELECT `id_product_rule_group` FROM `' . _DB_PREFIX_ . 'cart_rule_product_rule_group`)');
     $r &= Db::getInstance()->execute('DELETE FROM `' . _DB_PREFIX_ . 'cart_rule_product_rule_value` WHERE `id_product_rule` NOT IN (SELECT `id_product_rule` FROM `' . _DB_PREFIX_ . 'cart_rule_product_rule`)');
     return $r;
 }
開發者ID:jeprodev,項目名稱:jeproshop,代碼行數:20,代碼來源:cart.php

示例5: delete

 public function delete()
 {
     @unlink(_PS_DOWNLOAD_DIR_ . $this->file);
     $db = JFactory::getDBO();
     $query = "SELECT product_id FROM " . $db->quoteName('#__jeproshop_product_attachment') . " WHERE attachment_id = " . (int) $this->attachment_id;
     $db->setQuery($query);
     $products = $db->loadObjectList();
     $query = "DELETE FROM " . $db->quoteName('#__jeproshop_product_attachment') . " WHERE attachment_id = " . (int) $this->attachment_id;
     $db->setQuery($query);
     $db->query();
     foreach ($products as $product) {
         JeproshopProductModelProduct::updateCacheAttachment((int) $product->product_id);
     }
     return parent::delete();
 }
開發者ID:jeprodev,項目名稱:jeproshop,代碼行數:15,代碼來源:attachment.php

示例6: delete

    public function delete()
    {
        $products = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('
			SELECT ps.`id_product`
			FROM `' . _DB_PREFIX_ . 'product_shop` ps
			WHERE ps.`id_category_default` = ' . (int) $this->id_category);
        $ids = array();
        foreach ($products as $row) {
            $ids[] = $row['id_product'];
        }
        if ($ids) {
            Db::getInstance()->delete('product_group_reduction_cache', 'id_product IN (' . implode(', ', $ids) . ')');
        }
        return parent::delete();
    }
開發者ID:jeprodev,項目名稱:jeproshop,代碼行數:15,代碼來源:group.php

示例7: delete

 /**
  * @since 1.5.0
  * @see ObjectModel::delete()
  */
 public function delete()
 {
     if (!parent::delete()) {
         return false;
     }
     Carrier::cleanPositions();
     return Db::getInstance()->execute('DELETE FROM ' . _DB_PREFIX_ . 'cart_rule_carrier WHERE id_carrier = ' . (int) $this->id) && $this->deleteTaxRulesGroup(Shop::getShops(true, null, true));
 }
開發者ID:jeprodev,項目名稱:jeproshop,代碼行數:12,代碼來源:carrier.php

示例8: delete

 public function delete()
 {
     if (!empty($this->file_name)) {
         @unlink(_PS_UPLOAD_DIR_ . $this->file_name);
     }
     return parent::delete();
 }
開發者ID:jeprodev,項目名稱:jeproshop,代碼行數:7,代碼來源:customer.php

示例9: delete

 public function delete()
 {
     $db = JFactory::getDBO();
     if (!parent::delete()) {
         return false;
     }
     $query = "DELETE FROM " . $db->quoteName('#__jeproshop_cart_rule_country') . " WHERE " . $db->quoteName('country_id') . " = " . (int) $this->country_id;
     $db->setQuery($query);
     return $db->query();
 }
開發者ID:jeprodev,項目名稱:jeproshop,代碼行數:10,代碼來源:country.php

示例10: delete

 public function delete($delete_file = false)
 {
     $result = parent::delete();
     if ($result && $delete_file) {
         return $this->deleteFile();
     }
     return $result;
 }
開發者ID:jeprodev,項目名稱:jeproshop,代碼行數:8,代碼來源:product.php

示例11: delete

 public function delete()
 {
     /* Clean associations */
     JeproshopTaxRuleModelTaxRule::deleteTaxRuleByTaxId((int) $this->tax_id);
     if ($this->isUsed()) {
         return $this->historize();
     } else {
         return parent::delete();
     }
 }
開發者ID:jeprodev,項目名稱:jeproshop,代碼行數:10,代碼來源:tax.php

示例12: delete

 /**
  * Delete a zone
  *
  * @return boolean Deletion result
  */
 public function delete()
 {
     $db = JFactory::getDBO();
     if (parent::delete()) {
         // Delete regarding delivery preferences
         $query = "DELETE FROM " . $db->quoteName('#__jeproshop_carrier_zone') . " WHERE " . $db->quoteName('zone_id') . " = " . (int) $this->zone_id;
         $db->setQuery($query);
         $result = $db->query();
         $query = "DELETE FROM " . $db->quoteName('#__jeproshop_delivery') . " WHERE " . $db->quoteName('zone_id') . " = " . (int) $this->zone_id;
         $db->setQuery($query);
         $result &= $db->query();
         // Update Country & state zone with 0
         $query = "UPDATE " . $db->quoteName('#__jeproshop_country') . " SET " . $db->quoteName('zone_id') . " = 0 WHERE " . $db->quoteName('zone_id') . " = " . (int) $this->zone_id;
         $db->setQuery($query);
         $result &= $db->query();
         $query = "UPDATE " . $db->quoteName('#__jeproshop_state') . " SET " . $db->quoteName('zone_id') . " = 0 WHERE " . $db->quoteName('zone_id') . " = " . (int) $this->zone_id;
         $db->setQuery($query);
         $result &= $db->query();
         return $result;
     }
     return false;
 }
開發者ID:jeprodev,項目名稱:jeproshop,代碼行數:27,代碼來源:country.php


注:本文中的JModelLegacy::delete方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。