|
|
@@ -450,6 +450,12 @@ EOF_STRUCT_MYSQL;
|
|
|
}, $this->fetchAll($sql, $values));
|
|
|
}
|
|
|
|
|
|
+ public function fetchValuesListByKey($sql, $key, $values = []) { // for sql like `select ID from ...` @returns array of ID
|
|
|
+ return array_map(function ($row) {
|
|
|
+ return reset($row);
|
|
|
+ }, $this->fetchAllByKey($sql, $key, $values));
|
|
|
+ }
|
|
|
+
|
|
|
public function fetchFirst($sql, $values = []) { // fetch only first row
|
|
|
$sth = $this->prepare($sql);
|
|
|
if (!empty($values)) {
|