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


PHP AdapterInterface::insertFromSelect方法代码示例

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


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

示例1: reindexRootCategory

 /**
  * Reindex all products to root category
  *
  * @param \Magento\Store\Model\Store $store
  * @return void
  */
 protected function reindexRootCategory(\Magento\Store\Model\Store $store)
 {
     if ($this->isIndexRootCategoryNeeded()) {
         $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(), ['category_id', 'product_id', 'position', 'is_parent', 'store_id', 'visibility'], \Magento\Framework\DB\Adapter\AdapterInterface::INSERT_ON_DUPLICATE));
         }
     }
 }
开发者ID:rafaelstz,项目名称:magento2,代码行数:15,代码来源:AbstractAction.php

示例2: _insertFromTable

 /**
  * Copy data from source table to destination
  *
  * @param string $sourceTable
  * @param string $destTable
  * @param null|string $where
  * @return void
  */
 protected function _insertFromTable($sourceTable, $destTable, $where = null)
 {
     $sourceColumns = array_keys($this->_connection->describeTable($sourceTable));
     $targetColumns = array_keys($this->_connection->describeTable($destTable));
     $select = $this->_connection->select()->from($sourceTable, $sourceColumns);
     if ($where) {
         $select->where($where);
     }
     $query = $this->_connection->insertFromSelect($select, $destTable, $targetColumns, \Magento\Framework\DB\Adapter\AdapterInterface::INSERT_ON_DUPLICATE);
     $this->_connection->query($query);
 }
开发者ID:Doability,项目名称:magento2dev,代码行数:19,代码来源:AbstractAction.php

示例3: rollbackDocument

 /**
  * @inheritdoc
  */
 public function rollbackDocument($documentName)
 {
     $backupTableName = self::BACKUP_DOCUMENT_PREFIX . $documentName;
     if ($this->resourceAdapter->isTableExists($backupTableName)) {
         $this->resourceAdapter->truncateTable($documentName);
         $select = $this->resourceAdapter->select()->from($backupTableName);
         $query = $this->resourceAdapter->insertFromSelect($select, $documentName);
         $this->resourceAdapter->query($query);
         $this->resourceAdapter->dropTable($backupTableName);
     }
 }
开发者ID:victor-v-rad,项目名称:data-migration-tool,代码行数:14,代码来源:Mysql.php


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