本文整理汇总了PHP中Varien_Db_Adapter_Interface::fetchRow方法的典型用法代码示例。如果您正苦于以下问题:PHP Varien_Db_Adapter_Interface::fetchRow方法的具体用法?PHP Varien_Db_Adapter_Interface::fetchRow怎么用?PHP Varien_Db_Adapter_Interface::fetchRow使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Varien_Db_Adapter_Interface
的用法示例。
在下文中一共展示了Varien_Db_Adapter_Interface::fetchRow方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testInsertForce
/**
* @dataProvider insertDataProvider
*/
public function testInsertForce($data)
{
$this->assertEquals(1, $this->_connection->insertForce($this->_tableName, $data));
$select = $this->_connection->select()->from($this->_tableName);
$result = $this->_connection->fetchRow($select);
$this->assertEquals($data, $result);
}
示例2: testWriteEncoded
/**
* Assert that session data writes to DB in base64 encoding
*/
public function testWriteEncoded()
{
$data = serialize($this->_sessionData[self::SESSION_NEW]);
$this->_model->write(self::SESSION_ID, $data);
$select = $this->_connection->select()->from($this->_sessionTable)->where(self::COLUMN_SESSION_ID . ' = :' . self::COLUMN_SESSION_ID);
$bind = array(self::COLUMN_SESSION_ID => self::SESSION_ID);
$session = $this->_connection->fetchRow($select, $bind);
$this->assertEquals(self::SESSION_ID, $session[self::COLUMN_SESSION_ID]);
$this->assertTrue(ctype_digit((string) $session[self::COLUMN_SESSION_EXPIRES]), 'Value of session expire field must have integer type');
$this->assertEquals($data, base64_decode($session[self::COLUMN_SESSION_DATA]));
}
示例3: _isAvailableUrl
/**
* Check unique url_key value in catalog_category_entity_url_key table.
*
* @param Mage_Catalog_Model_Abstract $object
* @return bool
* @throws Mage_Core_Exception
*/
protected function _isAvailableUrl($object)
{
$select = $this->_connection->select()->from($this->getAttribute()->getBackendTable(), array('entity_id', 'store_id'))->where('value = ?', $object->getUrlKey())->limit(1);
$row = $this->_connection->fetchRow($select);
// we should allow save same url key for product in current store view
// but not allow save existing url key in current store view from another store view
if (empty($row)) {
return true;
} elseif ($object->getId() && $object->getStoreId() !== null && ($row['store_id'] == $object->getStoreId() && $row['entity_id'] == $object->getId())) {
return true;
}
return false;
}
示例4: getCategoryId
/**
* Retrieve category instance by specified parameters
*
* @param Mage_Core_Model_Resource $resource
* @param array $row
* @return int
*/
function getCategoryId($resource, $row)
{
$select = $this->_connection->select()->from(array('nur' => $resource->getTableName('enterprise_url_rewrite')))->join(array('e' => $resource->getTableName(array('catalog/category', 'url_key'))), 'nur.value_id = e.value_id')->where('nur.url_rewrite_id = ' . $row['url_rewrite_id']);
$entityRow = $this->_connection->fetchRow($select);
return $entityRow['entity_id'];
}