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


PHP Varien_Db_Adapter_Interface::delete方法代碼示例

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


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

示例1: _prepareAffectedProduct

 /**
  * Prepare affected product
  */
 protected function _prepareAffectedProduct()
 {
     /** @var $modelCondition Mage_Catalog_Model_Product_Condition */
     $modelCondition = $this->_factory->getModel('catalog/product_condition');
     $productCondition = $modelCondition->setTable($this->_resource->getTable('catalogrule/affected_product'))->setPkFieldName('product_id');
     $this->_app->dispatchEvent('catalogrule_after_apply', array('product' => $this->_getProduct(), 'product_condition' => $productCondition));
     $this->_connection->delete($this->_resource->getTable('catalogrule/affected_product'));
 }
開發者ID:QiuLihua83,項目名稱:magento-enterprise-1.13.1.0,代碼行數:11,代碼來源:Refresh.php

示例2: _moveAttributesData

 /**
  * @param Mage_Customer_Model_Customer $customer
  */
 protected function _moveAttributesData($customer)
 {
     $attributes = array('po_limit' => $this->_poLimitId, 'po_credit' => $this->_poCreditId);
     foreach ($attributes as $attributeCode => $attributeId) {
         try {
             $select = $this->_db->select()->from($customer->getResource()->getTable('customer_entity_int'), array('value'))->where('attribute_id = ?', $attributeId)->where('entity_id = ?', $customer->getId());
             $value = $this->_db->fetchOne($select);
             if ((int) $value > 0) {
                 $this->_db->insert($customer->getResource()->getTable('customer_entity_decimal'), array('entity_type_id' => $customer->getEntityTypeId(), 'attribute_id' => $attributeId, 'entity_id' => $customer->getId(), 'value' => (int) $value));
             }
         } catch (Exception $e) {
         }
         try {
             $this->_db->delete($customer->getResource()->getTable('customer_entity_int'), 'entity_type_id = ' . $customer->getEntityTypeId() . ' AND attribute_id = ' . $attributeId . ' AND ' . 'entity_id = ' . $customer->getId());
         } catch (Exception $e) {
         }
     }
 }
開發者ID:flintdigital,項目名稱:mage-mod-ar-po-emja,代碼行數:21,代碼來源:po_upgrade_3.0.3.php

示例3: execute

 /**
  * Refresh materialized view
  *
  * @return Enterprise_Mview_Model_Action_Mview_Refresh
  * @throws Exception
  */
 public function execute()
 {
     try {
         $insert = $this->_connection->insertFromSelect($this->_connection->select()->from($this->_metadata->getViewName()), $this->_metadata->getTableName());
         $this->_connection->delete($this->_metadata->getTableName());
         $this->_connection->query($insert);
         $this->_metadata->setValidStatus()->setVersionId($this->_selectLastVersionId())->save();
     } catch (Exception $e) {
         $this->_metadata->setInvalidStatus()->save();
         throw $e;
     }
     return $this;
 }
開發者ID:QiuLihua83,項目名稱:magento-enterprise-1.13.1.0,代碼行數:19,代碼來源:Refresh.php

示例4: execute

 /**
  * Method deletes old row in the mview table and insert new one from view.
  *
  * @return Enterprise_Mview_Model_Action_Mview_Create
  * @throws Enterprise_Mview_Exception
  */
 public function execute()
 {
     $this->_validate();
     $this->_connection->beginTransaction();
     try {
         $this->_connection->delete($this->_metadata->getTableName(), array($this->_metadata->getKeyColumn() . '=?' => $this->_keyColumnIdValue));
         $this->_connection->query($this->_getInsertSql());
         $this->_connection->commit();
     } catch (Exception $e) {
         $this->_connection->rollBack();
         throw new Enterprise_Mview_Exception($e->getMessage(), $e->getCode());
     }
     return $this;
 }
開發者ID:QiuLihua83,項目名稱:magento-enterprise-1.13.1.0,代碼行數:20,代碼來源:Row.php

示例5: execute

 /**
  * Refresh rows by ids from changelog
  *
  * @return Enterprise_Mview_Model_Action_Mview_Refresh_Changelog
  * @throws Enterprise_Mview_Exception
  */
 public function execute()
 {
     $this->_validate();
     $this->_connection->beginTransaction();
     try {
         $this->_connection->delete($this->_metadata->getTableName(), array($this->_metadata->getKeyColumn() . ' IN ( ' . $this->_selectChangedIds() . ' )'));
         $this->_connection->query($this->_connection->insertFromSelect($this->_selectChangedRows(), $this->_metadata->getTableName()));
         $this->_metadata->setVersionId($this->_selectLastVersionId());
         $this->_metadata->save();
         $this->_connection->commit();
     } catch (Exception $e) {
         $this->_connection->rollBack();
         $this->_metadata->setOutOfDateStatus()->save();
         throw new Enterprise_Mview_Exception($e->getMessage(), $e->getCode());
     }
     return $this;
 }
開發者ID:barneydesmond,項目名稱:propitious-octo-tribble,代碼行數:23,代碼來源:Changelog.php

示例6: gc

 /**
  * Garbage collection
  *
  * @param int $maxLifeTime
  * @return boolean
  */
 public function gc($maxLifeTime)
 {
     $where = array('session_expires < ?' => time() - $maxLifeTime);
     $this->_write->delete($this->_sessionTable, $where);
     return true;
 }
開發者ID:natxetee,項目名稱:magento2,代碼行數:12,代碼來源:Session.php

示例7: execute

 /**
  * Clear changelog table
  *
  * @return Enterprise_Mview_Model_Action_Changelog_Clear
  */
 public function execute()
 {
     $this->_connection->delete($this->_metadata->getChangelogName(), array('version_id < ?' => $this->_metadata->getVersionId()));
     return $this;
 }
開發者ID:hientruong90,項目名稱:ee_14_installer,代碼行數:10,代碼來源:Clear.php

示例8: _deleteSpecificTypeValues

 /**
  * Delete custom option type values
  *
  * @param array $optionIds
  * @return Mage_ImportExport_Model_Import_Entity_Product_Option
  */
 protected function _deleteSpecificTypeValues(array $optionIds)
 {
     $this->_connection->delete($this->_tables['catalog_product_option_type_value'], $this->_connection->quoteInto('option_id IN (?)', $optionIds));
     return $this;
 }
開發者ID:nemphys,項目名稱:magento2,代碼行數:11,代碼來源:Option.php


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