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


PHP Varien_Db_Adapter_Interface::newTable方法代碼示例

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


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

示例1: setUp

 protected function setUp()
 {
     $installer = new Mage_Core_Model_Resource_Setup(Mage_Core_Model_Resource_Setup::DEFAULT_SETUP_CONNECTION);
     $this->_connection = $installer->getConnection();
     $this->_tableName = $installer->getTable('table_two_column_idx');
     $this->_oneColumnIdxName = $installer->getIdxName($this->_tableName, array('column1'));
     $this->_twoColumnIdxName = $installer->getIdxName($this->_tableName, array('column1', 'column2'));
     $table = $this->_connection->newTable($this->_tableName)->addColumn('id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array('identity' => true, 'unsigned' => true, 'nullable' => false, 'primary' => true), 'Id')->addColumn('column1', Varien_Db_Ddl_Table::TYPE_INTEGER)->addColumn('column2', Varien_Db_Ddl_Table::TYPE_INTEGER)->addIndex($this->_oneColumnIdxName, array('column1'))->addIndex($this->_twoColumnIdxName, array('column1', 'column2'));
     $this->_connection->createTable($table);
 }
開發者ID:nemphys,項目名稱:magento2,代碼行數:10,代碼來源:InterfaceTest.php

示例2: _createTemporaryTable

 /**
  * Create temporary table
  */
 protected function _createTemporaryTable()
 {
     $this->_connection->dropTemporaryTable($this->_getTemporaryTable());
     $table = $this->_connection->newTable($this->_getTemporaryTable())->addColumn('grouped_id', Varien_Db_Ddl_Table::TYPE_VARCHAR, 80, array(), 'Grouped ID')->addColumn('product_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array('unsigned' => true), 'Product ID')->addColumn('customer_group_id', Varien_Db_Ddl_Table::TYPE_SMALLINT, 5, array('unsigned' => true), 'Customer Group ID')->addColumn('from_date', Varien_Db_Ddl_Table::TYPE_DATE, null, array(), 'From Date')->addColumn('to_date', Varien_Db_Ddl_Table::TYPE_DATE, null, array(), 'To Date')->addColumn('action_amount', Varien_Db_Ddl_Table::TYPE_DECIMAL, '12,4', array(), 'Action Amount')->addColumn('action_operator', Varien_Db_Ddl_Table::TYPE_VARCHAR, 10, array(), 'Action Operator')->addColumn('action_stop', Varien_Db_Ddl_Table::TYPE_SMALLINT, 6, array(), 'Action Stop')->addColumn('sort_order', Varien_Db_Ddl_Table::TYPE_INTEGER, 10, array('unsigned' => true), 'Sort Order')->addColumn('price', Varien_Db_Ddl_Table::TYPE_DECIMAL, '12,4', array(), 'Product Price')->addColumn('rule_product_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array('unsigned' => true), 'Rule Product ID')->addColumn('from_time', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array('unsigned' => true, 'nullable' => true, 'default' => 0), 'From Time')->addColumn('to_time', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array('unsigned' => true, 'nullable' => true, 'default' => 0), 'To Time')->addIndex($this->_connection->getIndexName($this->_getTemporaryTable(), 'grouped_id'), array('grouped_id'))->setComment('CatalogRule Price Temporary Table');
     $this->_connection->createTemporaryTable($table);
 }
開發者ID:QiuLihua83,項目名稱:magento-enterprise-1.13.1.0,代碼行數:9,代碼來源:Refresh.php

示例3: _getChangelogTableConfig

 /**
  * Prepare changelog table definition
  *
  * @return Varien_Db_Ddl_Table
  */
 protected function _getChangelogTableConfig()
 {
     $column = $this->_getKeyColumnConfig();
     return $this->_connection->newTable($this->_changelog->getObjectName(), $this->_changelog->getSchemaName())->addColumn('version_id', Varien_Db_Ddl_Table::TYPE_BIGINT, null, array('unsigned' => true, 'nullable' => false, 'primary' => true, 'auto_increment' => true), 'Version')->addColumn($this->_metadata->getKeyColumn(), $column['type'], $column['length'], array('unsigned' => !empty($options['unsigned']), 'nullable' => false), $column['comment'])->setComment(sprintf('Changelog for table `%s`', $this->_table->getObjectName()));
 }
開發者ID:QiuLihua83,項目名稱:magento-enterprise-1.13.1.0,代碼行數:10,代碼來源:Create.php

示例4: _createTmpTable

 /**
  * Create tmp table
  */
 protected function _createTmpTable()
 {
     $table = $this->_connection->newTable($this->_getMainTmpTable())->addColumn('category_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array('unsigned' => true, 'nullable' => false, 'primary' => true, 'default' => '0'), 'Category ID')->addColumn('product_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array('unsigned' => true, 'nullable' => false, 'primary' => true, 'default' => '0'), 'Product ID')->addColumn('position', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array('unsigned' => false, 'nullable' => true, 'default' => null), 'Position')->addColumn('is_parent', Varien_Db_Ddl_Table::TYPE_SMALLINT, null, array('unsigned' => true, 'nullable' => false, 'default' => '0'), 'Is Parent')->addColumn('store_id', Varien_Db_Ddl_Table::TYPE_SMALLINT, null, array('unsigned' => true, 'nullable' => false, 'primary' => true, 'default' => '0'), 'Store ID')->addColumn('visibility', Varien_Db_Ddl_Table::TYPE_SMALLINT, null, array('unsigned' => true, 'nullable' => false), 'Visibility')->setComment('Catalog Category Product Index Tmp');
     $this->_connection->dropTemporaryTable($this->_getMainTmpTable());
     $this->_connection->createTemporaryTable($table);
 }
開發者ID:hientruong90,項目名稱:ee_14_installer,代碼行數:9,代碼來源:Refresh.php

示例5: _createRedirectTemporaryTable

 /**
  * Create redirects temporary table
  *
  * @return void
  */
 protected function _createRedirectTemporaryTable()
 {
     $temporaryTable = $this->_connection->newTable(self::TMP_TABLE_NAME);
     $temporaryTable->addColumn('identifier', Varien_Db_Ddl_Table::TYPE_VARCHAR, 255)->addColumn('target_path', Varien_Db_Ddl_Table::TYPE_VARCHAR, 255)->addColumn('store_id', Varien_Db_Ddl_Table::TYPE_INTEGER)->addColumn('category_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array('unsigned' => true))->addColumn('product_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array('unsigned' => true))->addIndex('UNQ_ENTERPRISE_URL_REWRITE_TMP_IDENTIFIER_STORE_ID', array('identifier', 'store_id'), array('type' => Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE));
     $this->_connection->createTemporaryTable($temporaryTable);
 }
開發者ID:QiuLihua83,項目名稱:magento-enterprise-1.13.1.0,代碼行數:11,代碼來源:Redirect.php


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