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


PHP Varien_Db_Adapter_Interface::insertFromSelect方法代码示例

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


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

示例1: _reindex

 /**
  * Reindex catalog prices by website for timestamp
  *
  * @param Mage_Core_Model_Website $website
  * @param int $timestamp
  */
 protected function _reindex(Mage_Core_Model_Website $website, $timestamp)
 {
     $this->_createTemporaryTable();
     $this->_connection->query($this->_connection->insertFromSelect($this->_prepareTemporarySelect($website), $this->_getTemporaryTable()));
     $this->_removeOldIndexData($website);
     $this->_fillIndexData($website, $timestamp);
 }
开发者ID:QiuLihua83,项目名称:magento-enterprise-1.13.1.0,代码行数:13,代码来源:Refresh.php

示例2: _refreshRelation

 /**
  * Refresh redirect to url rewrite relations
  *
  * @return Enterprise_UrlRewrite_Model_Index_Action_Url_Rewrite_RefreshAbstract
  */
 protected function _refreshRelation()
 {
     $insert = $this->_connection->insertFromSelect($this->_getRefreshRelationSelectSql(), $this->_relationTableName, $this->_relationColumns);
     $insert .= sprintf(' ON DUPLICATE KEY UPDATE %1$s = VALUES(%1$s)', $this->_connection->quoteIdentifier('url_rewrite_id'));
     $this->_connection->query($insert);
     return $this;
 }
开发者ID:barneydesmond,项目名称:propitious-octo-tribble,代码行数:12,代码来源:RefreshAbstract.php

示例3: _reindexRootCategory

 /**
  * Reindex all products to root category
  *
  * @param Mage_Core_Model_Store $store
  */
 protected function _reindexRootCategory(Mage_Core_Model_Store $store)
 {
     $selects = $this->_prepareSelectsByRange($this->_getAllProducts($store), 'entity_id', self::RANGE_PRODUCT_STEP);
     foreach ($selects as $select) {
         $this->_connection->query($this->_connection->insertFromSelect($select, $this->_getMainTmpTable(), array('category_id', 'product_id', 'position', 'is_parent', 'store_id', 'visibility'), Varien_Db_Adapter_Interface::INSERT_IGNORE));
     }
 }
开发者ID:hientruong90,项目名称:ee_14_installer,代码行数:12,代码来源:Refresh.php

示例4: 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

示例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: _getInsertSql

 /**
  * Returns insert sql
  *
  * @return string
  */
 public function _getInsertSql()
 {
     return $this->_connection->insertFromSelect($this->_getSelectSql(), $this->_metadata->getTableName());
 }
开发者ID:QiuLihua83,项目名称:magento-enterprise-1.13.1.0,代码行数:9,代码来源:Row.php


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