restoration after wrong rollback

git-svn-id: svn+ssh://code.netmonsters.ru/svn/majestic/trunk@89 4cb57b5f-5bbd-dd11-951b-001d605cbbc5
This commit is contained in:
akulikov
2009-05-07 08:20:46 +00:00
parent 7754a67a07
commit efa2db60f2
3 changed files with 73 additions and 3 deletions

View File

@ -183,6 +183,28 @@ class ModelSelectResult extends ModelResult
return $array;
}
/**
* Fetches all SQL result rows as an array of key-value pairs.
*
* The first column is the key, the second column is the
* value.
*
* @return array
*/
public function fetchPairs()
{
if (!method_exists('DBConnector', 'fetchArray')) {
throw new Exception('Method not implemented yet.');
}
$data = array();
while ($row = DBConnector::fetchArray($this->result, DBConnector::FETCH_NUM)) {
$data[$row[0]] = $row[1];
}
return $data;
}
function count()
{
return DBConnector::numRows($this->result);