Details
-
Type:
New Feature
-
Status:
Resolved
-
Priority:
Minor
-
Resolution: Not an Issue
-
Affects Version/s: 0.7.0
-
Fix Version/s: 1.8.0
-
Component/s: Zend_Db_Table
-
Labels:None
-
Fix Version Priority:Nice to Have
Description
i've wanted to count row results to build a nice helper which organizes my index-views more comfortable.
so i've added ..
Zend/Db/Table.php
/**
* Fetches the number of row results.
*
* @return int The number of row results
*/
public function fetchCount($where = null)
{
return (int)$this->_fetch('Count', $where);
}
.. and changed ..
Zend/Db/Table.php - protected function _fetch
// the FROM clause $select->from($this->_name, array_keys($this->_cols));
.. to ..
Zend/Db/Table.php - protected function _fetch
// the FROM clause if ($type == 'Count') { $select->from($this->_name, 'count(*)'); $type = 'One'; } else $select->from($this->_name, array_keys($this->_cols));
.. which gives me a Zend_Db_Table::fetchCount($where)-function returning the number of row results ![]()
Issue Links
| This issue is related to: | ||||
| ZF-1335 | Provide table-specific SELECT queries with select() method |
|
|
|
Please categorize/fix as needed.