本文整理匯總了PHP中Zend_Db_Table_Abstract::fetchRow方法的典型用法代碼示例。如果您正苦於以下問題:PHP Zend_Db_Table_Abstract::fetchRow方法的具體用法?PHP Zend_Db_Table_Abstract::fetchRow怎麽用?PHP Zend_Db_Table_Abstract::fetchRow使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Zend_Db_Table_Abstract
的用法示例。
在下文中一共展示了Zend_Db_Table_Abstract::fetchRow方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getAttribute
public function getAttribute($id)
{
if (isset($this->_attributes[$id])) {
return $this->_attributes[$id];
} elseif (is_numeric($id)) {
$attribute = $this->_attributeModel->find($id)->current();
} else {
$where = $this->_attributeModel->select()->where($this->_attributeFieldName . ' = ?', $id);
$attribute = $this->_attributeModel->fetchRow($where);
}
$this->cacheAttribute($attribute);
return $attribute;
}
示例2: get_sort_categories_parents
/**
*
*/
public function get_sort_categories_parents($parentId, $children = array(), $cur_level = 0)
{
$res_ar = array();
$parent = parent::fetchRow('id=' . $parentId)->toArray();
$parent['level'] = $cur_level;
$Product = new Product();
$c = $Product->getProductCount($parent['children']);
$parent['c_count'] = $c;
$res_ar = array_merge(array($parent), $children);
if ($parent['parentId'] > 0) {
$res_ar = $this->get_sort_categories_parents($parent['parentId'], $res_ar, $cur_level - 1);
}
return $res_ar;
}
示例3: loadRow
public function loadRow($value, $field = false) {
$select = $this->table->select();
//$this->table->getAdapter()->quote($v)
// Check if value is an array
if (is_array($value)) {
foreach ($value as $k => $v) {
$select->where("`$k` = ?", $v);
}
}
else {
if (!$field) {
$field = $this->table->getPrimary();
}
$select->where("`$field` = ?", $value);
}
$this->row = $this->table->fetchRow($select);
}
示例4: findBySlug
/**
* Find by slug
*
* @param string $slug
* @return App_Table
*/
public function findBySlug($slug)
{
$select = $this->select();
$select->where('slug = ?', $slug);
return parent::fetchRow($select);
}
示例5: fetchRow
/** Fetch one result
* @access public
* @param array $where
* @param string $order
* @return Object
*/
public function fetchRow($where = null, $order = null)
{
$id = md5($where->__toString());
if (!$this->_cache->test($id) || !$this->cache_result) {
$result = parent::fetchRow($where, $order);
$this->_cache->save($result);
return $result;
} else {
return $this->_cache->load($id);
}
}
示例6: fetchRow
/**
* (non-PHPdoc)
* @see Zend_Db_Table_Abstract::fetchRow()
*/
public function fetchRow($where = null, $order = null, $offset = null)
{
$row = parent::fetchRow($where, $order, $offset);
return $row;
}
示例7: lastRow
/**
* 取得最後一條記錄
*
* @return ZtChart_Model_Db_Table_Row
*/
public function lastRow()
{
return parent::fetchRow(null, array_map(function ($primary) {
return $primary . ' DESC';
}, $this->info(parent::PRIMARY)));
}