Skip to content

Commit 8113241

Browse files
committed
Update FluentAdapter.php
I think it'll be better to setFetchMode to \PDO::FETCH_OBJ before getConnection() return. in case of the default database config is not.
1 parent 622cca5 commit 8113241

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/Storage/FluentAdapter.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ public function setConnectionName($connectionName)
4949

5050
protected function getConnection()
5151
{
52-
return $this->resolver->connection($this->connectionName);
52+
$conn = $this->resolver->connection($this->connectionName);
53+
// maybe others have the database config for fetch mode to PDO::FETCH_ASSOC
54+
// u'd better force it back here, or all your data fetching result will be unusable.
55+
$conn->setFetchMode(\PDO::FETCH_OBJ);
56+
return $conn;
5357
}
54-
}
58+
}

0 commit comments

Comments
 (0)