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


PHP Varien_Db_Adapter_Interface::fetchRow方法代碼示例

本文整理匯總了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);
 }
開發者ID:nemphys,項目名稱:magento2,代碼行數:10,代碼來源:InterfaceTest.php

示例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]));
 }
開發者ID:natxetee,項目名稱:magento2,代碼行數:14,代碼來源:SessionTest.php

示例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;
 }
開發者ID:QiuLihua83,項目名稱:magento-enterprise-1.13.1.0,代碼行數:20,代碼來源:Urlkey.php

示例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'];
 }
開發者ID:hyhoocchan,項目名稱:mage-local,代碼行數:13,代碼來源:Migration.php


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