当前位置: 首页>>代码示例>>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;未经允许,请勿转载。