We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6f1e5be commit d07a20fCopy full SHA for d07a20f
src/Builder/RunnableSelect.php
@@ -86,14 +86,22 @@ public function fetchRow() {
86
}
87
88
/**
89
+ * @param bool $treatValueAsArray
90
* @return mixed[]
91
*/
- public function fetchKeyValue() {
92
+ public function fetchKeyValue($treatValueAsArray = false) {
93
$rows = $this->fetchRows();
94
$result = array();
- foreach($rows as $row) {
95
- list($key, $value) = array_values($row);
96
- $result[$key] = $value;
+ if(!$treatValueAsArray) {
+ foreach($rows as $row) {
97
+ list($key, $value) = array_values($row);
98
+ $result[$key] = $value;
99
+ }
100
+ } else {
101
102
+ list($key) = array_values($row);
103
+ $result[$key] = $row;
104
105
106
return $result;
107
0 commit comments