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


PHP unknown_type::fetchRow方法代碼示例

本文整理匯總了PHP中unknown_type::fetchRow方法的典型用法代碼示例。如果您正苦於以下問題:PHP unknown_type::fetchRow方法的具體用法?PHP unknown_type::fetchRow怎麽用?PHP unknown_type::fetchRow使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在unknown_type的用法示例。


在下文中一共展示了unknown_type::fetchRow方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: _query

 /**
  * Run query and returns matches, or null if no matches are found.
  *
  * @param  String $value
  * @return Array when matches are found.
  */
 protected function _query($value)
 {
     /**
      * Check for an adapter being defined. if not, fetch the default adapter.
      */
     if ($this->_adapter === null) {
         $this->_adapter = Zend_Db_Table_Abstract::getDefaultAdapter();
         if (null === $this->_adapter) {
             require_once 'Zend/Validate/Exception.php';
             throw new Zend_Validate_Exception('No database adapter present');
         }
     }
     /**
      * Build select object
      */
     $select = new Zend_Db_Select($this->_adapter);
     $select->from($this->_table, array($this->_field), $this->_schema)->where($this->_adapter->quoteIdentifier($this->_field) . ' = ?', $value);
     if ($this->_exclude !== null) {
         if (is_array($this->_exclude)) {
             $select->where($this->_adapter->quoteIdentifier($this->_exclude['field']) . ' != ?', $this->_exclude['value']);
         } else {
             $select->where($this->_exclude);
         }
     }
     $select->limit(1);
     /**
      * Run query
      */
     $result = $this->_adapter->fetchRow($select, array(), Zend_Db::FETCH_ASSOC);
     return $result;
 }
開發者ID:kokx,項目名稱:zf-library,代碼行數:37,代碼來源:Abstract.php

示例2: _query

 /**
  * Run query and returns matches, or null if no matches are found.
  *
  * @param  String $value
  * @return Array when matches are found.
  */
 protected function _query($value)
 {
     /**
      * Check for an adapter being defined. if not, fetch the default adapter.
      */
     if ($this->_adapter === null) {
         $this->_adapter = Zend_Db_Table_Abstract::getDefaultAdapter();
     }
     /**
      * Build select object
      */
     $select = new Zend_Db_Select($this->_adapter);
     $select->from($this->_table, array($this->_field))->where($this->_adapter->quoteIdentifier($this->_field) . ' = ?', $value);
     if ($this->_exclude !== null) {
         if (is_array($this->_exclude)) {
             $select->where($this->_adapter->quoteIdentifier($this->_exclude['field']) . ' != ?', $this->_exclude['value']);
         } else {
             $select->where($this->_exclude);
         }
     }
     $select->limit(1);
     /**
      * Run query
      */
     $result = $this->_adapter->fetchRow($select, array(), Zend_Db::FETCH_ASSOC);
     return $result;
 }
開發者ID:VUW-SIM-FIS,項目名稱:emiemi,代碼行數:33,代碼來源:Abstract.php

示例3: editAction

 /**
  * 
  * (non-PHPdoc)
  * @see Crud/Controller/Fgsl_Crud_Controller_Interface#editAction()
  */
 public function editAction()
 {
     $fieldKey = $this->_model->getFieldKey();
     $record = $this->_model->fetchRow("{$fieldKey} = {$this->_getParam($fieldKey)}");
     $_POST = array();
     foreach ($this->_fieldNames as $fieldName) {
         if (isset($record->{$fieldName})) {
             $_POST[$fieldName] = $record->{$fieldName};
         }
     }
     Fgsl_Session_Namespace::set('post', new Zend_Filter_Input(null, null, $_POST));
     $this->_forward('insert');
 }
開發者ID:rogeriopradoj,項目名稱:temostudo,代碼行數:18,代碼來源:Abstract.php


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