actually bring back deprecated methods, keep them for now to maintain backwards compatability
This commit is contained in:
39
db.class.php
39
db.class.php
@@ -861,6 +861,7 @@ class MeekroDB {
|
||||
return $return;
|
||||
}
|
||||
|
||||
|
||||
public function queryFirstRow() {
|
||||
$args = func_get_args();
|
||||
$result = call_user_func_array(array($this, 'query'), $args);
|
||||
@@ -868,6 +869,7 @@ class MeekroDB {
|
||||
return reset($result);
|
||||
}
|
||||
|
||||
|
||||
public function queryFirstList() {
|
||||
$args = func_get_args();
|
||||
$result = call_user_func_array(array($this, 'queryAllLists'), $args);
|
||||
@@ -894,8 +896,45 @@ class MeekroDB {
|
||||
$row = call_user_func_array(array($this, 'queryFirstList'), $args);
|
||||
if ($row == null) return null;
|
||||
return $row[0];
|
||||
}
|
||||
|
||||
// --- begin deprecated methods (kept for backwards compatability)
|
||||
public function queryOneList() { $args = func_get_args(); return call_user_func_array(array($this, 'queryFirstList'), $args); }
|
||||
public function queryOneRow() { $args = func_get_args(); return call_user_func_array(array($this, 'queryFirstRow'), $args); }
|
||||
|
||||
public function queryOneField() {
|
||||
$args = func_get_args();
|
||||
$column = array_shift($args);
|
||||
|
||||
$row = call_user_func_array(array($this, 'queryOneRow'), $args);
|
||||
if ($row == null) {
|
||||
return null;
|
||||
} else if ($column === null) {
|
||||
$keys = array_keys($row);
|
||||
$column = $keys[0];
|
||||
}
|
||||
|
||||
return $row[$column];
|
||||
}
|
||||
|
||||
public function queryOneColumn() {
|
||||
$args = func_get_args();
|
||||
$column = array_shift($args);
|
||||
$results = call_user_func_array(array($this, 'query'), $args);
|
||||
$ret = array();
|
||||
|
||||
if (!count($results) || !count($results[0])) return $ret;
|
||||
if ($column === null) {
|
||||
$keys = array_keys($results[0]);
|
||||
$column = $keys[0];
|
||||
}
|
||||
|
||||
foreach ($results as $row) {
|
||||
$ret[] = $row[$column];
|
||||
}
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user