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