Skip to content

Commit b555d1e

Browse files
committed
Fixed database storage listing implementation.
1 parent 6fc5caf commit b555d1e

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/Darya/Database/Storage.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,17 @@ public function distinct($table, $column, array $filter = array(), $order = arra
283283
public function listing($table, $column, array $filter = array(), $order = array(), $limit = null, $offset = 0) {
284284
$query = $this->prepareSelect($table, "$column", $this->prepareWhere($filter), $this->prepareOrderBy($order), $this->prepareLimit($limit, $offset));
285285

286-
return $this->connection->query($query)->data;
286+
$rows = $this->connection->query($query)->data;
287+
288+
$data = array();
289+
290+
foreach ($rows as $row) {
291+
if (isset($row[$column])) {
292+
$data[] = $row[$column];
293+
}
294+
}
295+
296+
return $data;
287297
}
288298

289299
/**

0 commit comments

Comments
 (0)