本文整理汇总了PHP中Mage_Eav_Model_Entity_Setup::getConnection方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Eav_Model_Entity_Setup::getConnection方法的具体用法?PHP Mage_Eav_Model_Entity_Setup::getConnection怎么用?PHP Mage_Eav_Model_Entity_Setup::getConnection使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mage_Eav_Model_Entity_Setup
的用法示例。
在下文中一共展示了Mage_Eav_Model_Entity_Setup::getConnection方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
<?php
$installer = new Mage_Eav_Model_Entity_Setup('core_setup');
$installer->startSetup();
/**
* Fixes all indexes
*/
$installer->getConnection()->addKey($installer->getTable('payperrentals/reservationorders'), 'IDX_start_end', array('start_date', 'end_date'));
$installer->getConnection()->addKey($installer->getTable('payperrentals/reservationorders'), 'IDX_send_return_id', 'sendreturn_id');
$installer->getConnection()->addKey($installer->getTable('payperrentals/reservationorders'), 'IDX_turnover_start_end', array('start_turnover_before', 'end_turnover_after'));
$installer->getConnection()->dropKey($installer->getTable('payperrentals/reservationprices'), 'entity_id');
$installer->getConnection()->addKey($installer->getTable('payperrentals/reservationprices'), 'IDX_entity_id', 'entity_id');
$installer->getConnection()->addKey($installer->getTable('payperrentals/reservationprices'), 'IDX_store_id', 'store_id');
$installer->getConnection()->addKey($installer->getTable('payperrentals/reservationprices'), 'IDX_date_from_to', array('date_from', 'date_to'));
$installer->getConnection()->addKey($installer->getTable('payperrentals/reservationprices'), 'IDX_ptype', 'ptype');
$installer->getConnection()->addKey($installer->getTable('payperrentals/reservationprices'), 'IDX_numberof', 'numberof');
$installer->getConnection()->dropKey($installer->getTable('payperrentals/sendreturn'), 'order_id');
$installer->getConnection()->addKey($installer->getTable('payperrentals/sendreturn'), 'IDX_order_id', 'order_id');
$installer->getConnection()->addKey($installer->getTable('payperrentals/sendreturn'), 'IDX_order_id', 'order_id');
$installer->getConnection()->addKey($installer->getTable('payperrentals/sendreturn'), 'IDX_res_start_end', array('res_startdate', 'res_enddate'));
$installer->getConnection()->addKey($installer->getTable('payperrentals/sendreturn'), 'IDX_send_return', array('send_date', 'return_date'));
$installer->getConnection()->dropKey($installer->getTable('payperrentals/serialnumbers'), 'entity_id');
$installer->getConnection()->addKey($installer->getTable('payperrentals/serialnumbers'), 'IDX_entity_id', 'entity_id');
$installer->getConnection()->addKey($installer->getTable('payperrentals/serialnumbers'), 'IDX_status', 'status');
$installer->getConnection()->addKey($installer->getTable('payperrentals/ordertodates'), 'IDX_event_date', 'event_date');
$installer->getConnection()->addKey($installer->getTable('payperrentals/rentalqueue'), 'IDX_customer_id', 'customer_id');
$installer->getConnection()->addKey($installer->getTable('payperrentals/rentalqueue'), 'IDX_sendreturn_id', 'sendreturn_id');
$installer->getConnection()->dropKey($installer->getTable('payperrentals/rentalqueue'), 'product_id');
$installer->getConnection()->addKey($installer->getTable('payperrentals/rentalqueue'), 'IDX_product_id', 'product_id');
$installer->getConnection()->addKey($installer->getTable('payperrentals/reservationquotes'), 'IDX_quote_item_id', 'quote_item_id');
$installer->getConnection()->addKey($installer->getTable('payperrentals/reservationquotes'), 'IDX_quote_id', 'quote_id');
示例2: __construct
/**
* Setup setup class and connection
*/
public function __construct()
{
$this->_setup = Mage::getModel('eav/entity_setup', 'core_setup');
$this->_connection = $this->_setup->getConnection();
}
示例3: array
<?php
$installer = $this;
$installer->startSetup();
$setup = new Mage_Eav_Model_Entity_Setup('core_setup');
//this will set data of attribute for root category
Mage::getModel('catalog/category')->load(1)->setImportedCatId(0)->setInitialSetupFlag(true)->save();
//this will set data of attribute for default category
Mage::getModel('catalog/category')->load(2)->setImportedCatId(0)->setInitialSetupFlag(true)->save();
$setup->getConnection()->addColumn($this->getTable('db1_anymarket/anymarketcategories'), 'nmc_id_magento', array('type' => Varien_Db_Ddl_Table::TYPE_TEXT, 'nullable' => false, 'length' => 255, 'comment' => 'ID Category in Magento'));
$installer->endSetup();
示例4: array
<?php
$installer = new Mage_Eav_Model_Entity_Setup('core_setup');
$installer->getConnection()->addColumn($installer->getTable('catalog/eav_attribute'), 'enable_layered_swatch', array('type' => Varien_Db_Ddl_Table::TYPE_BOOLEAN, 'nullable' => true, 'default' => '0', 'comment' => 'Enable swatch in layered navigation'));
$installer->endSetup();
示例5: _removeResources
protected function _removeResources($module)
{
$modulePreffix = preg_replace('|[^a-z]|', '', strtolower($module));
$this->_setup->getConnection()->delete($this->_setup->getTable('core/resource'), 'code LIKE "' . $modulePreffix . '%"');
}
示例6: array
<?php
$installer = $this;
$installer->startSetup();
$setup = new Mage_Eav_Model_Entity_Setup('core_setup');
/**
$setup->addAttribute('order', Vikont_EVOConnector_Helper_Data::ORDER_EVO_STATUS_FIELD, array(
'position' => 1,
'input' => 'text',
'type' => 'tinyint',
'label' => 'EVO Order State',
'visible' => 0,
'required' => 0,
'user_defined' => 0,
'global' => 1,
'default' => 0,
'visible_on_front' => 0,
));/**/
$setup->addAttribute(Mage_Sales_Model_Order::ENTITY, Vikont_EVOConnector_Helper_Data::ORDER_EVO_STATUS_FIELD, array('type' => 'static', 'required' => 0, 'label' => 'EVO Order State', 'default' => 0, 'visible' => false, 'input' => 'text', 'global' => 1));
$setup->getConnection()->addColumn($setup->getTable('sales_flat_order'), Vikont_EVOConnector_Helper_Data::ORDER_EVO_STATUS_FIELD, 'TINYINT(1) UNSIGNED NOT NULL DEFAULT 0');
$setup->run("UPDATE `{$setup->getTable('sales_flat_order')}` SET " . Vikont_EVOConnector_Helper_Data::ORDER_EVO_STATUS_FIELD . "=1 WHERE status<>'pending'");
$installer->run('');
$installer->endSetup();
示例7: array
<?php
$installer = new Mage_Eav_Model_Entity_Setup('core_setup');
$installer->getConnection()->addColumn($installer->getTable('catalog/eav_attribute'), 'layered_filter_option', array('type' => Varien_Db_Ddl_Table::TYPE_INTEGER, 'nullable' => true, 'default' => '-1', 'comment' => 'Attribute options on layred navigation'));
$installer->endSetup();