本文整理汇总了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);
}
示例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;
}
示例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));
}
}
示例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;
}
示例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;
}
示例6: _getInsertSql
/**
* Returns insert sql
*
* @return string
*/
public function _getInsertSql()
{
return $this->_connection->insertFromSelect($this->_getSelectSql(), $this->_metadata->getTableName());
}