本文整理匯總了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;
}