本文整理汇总了PHP中Varien_Db_Adapter_Interface::insertOnDuplicate方法的典型用法代码示例。如果您正苦于以下问题:PHP Varien_Db_Adapter_Interface::insertOnDuplicate方法的具体用法?PHP Varien_Db_Adapter_Interface::insertOnDuplicate怎么用?PHP Varien_Db_Adapter_Interface::insertOnDuplicate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Varien_Db_Adapter_Interface
的用法示例。
在下文中一共展示了Varien_Db_Adapter_Interface::insertOnDuplicate方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testReadEncoded
/**
* Assert that session data reads from DB correctly regardless of encoding
*
* @param string $sessionData
*
* @dataProvider readEncodedDataProvider
*/
public function testReadEncoded($sessionData)
{
$sessionRecord = array(self::COLUMN_SESSION_ID => self::SESSION_ID, self::COLUMN_SESSION_DATA => $sessionData);
$this->_connection->insertOnDuplicate($this->_sessionTable, $sessionRecord, array(self::COLUMN_SESSION_DATA));
$sessionData = $this->_model->read(self::SESSION_ID);
$this->assertEquals($this->_sourceData[self::SESSION_NEW], unserialize($sessionData));
}
示例2: testInsertOnDuplicate
/**
* @dataProvider insertDataProvider
*/
public function testInsertOnDuplicate($data)
{
$this->_connection->insertOnDuplicate($this->_tableName, $data);
$select = $this->_connection->select()->from($this->_tableName);
$result = $this->_connection->fetchRow($select);
$this->assertEquals($data, $result);
}
示例3: _updateProducts
/**
* Update product data which related to custom options information
*
* @param array $data product data which will be updated
* @return Mage_ImportExport_Model_Import_Entity_Product_Option
*/
protected function _updateProducts(array $data)
{
if ($data) {
$this->_connection->insertOnDuplicate($this->_tables['catalog_product_entity'], $data, array('has_options', 'required_options', 'updated_at'));
}
return $this;
}