本文整理汇总了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;
}
示例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;
}
示例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');
}