File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -45,6 +45,7 @@ class Connection implements IConnection
4545 * Connection options: (see driver-specific options too)
4646 * - lazy (bool) => if true, connection will be established only when required
4747 * - result (array) => result set options
48+ * - normalize => normalizes result fields (default: true)
4849 * - formatDateTime => date-time format
4950 * empty for decoding as Dibi\DateTime (default)
5051 * "..." formatted according to given format, see https://www.php.net/manual/en/datetime.format.php
@@ -401,7 +402,7 @@ public function rollback(string $savepoint = null): void
401402 */
402403 public function createResultSet (ResultDriver $ resultDriver ): Result
403404 {
404- return (new Result ($ resultDriver ))
405+ return (new Result ($ resultDriver, $ this -> config [ ' result ' ][ ' normalize ' ] ?? true ))
405406 ->setFormats ($ this ->formats );
406407 }
407408
Original file line number Diff line number Diff line change @@ -41,10 +41,12 @@ class Result implements IDataSource
4141 private $ formats = [];
4242
4343
44- public function __construct (ResultDriver $ driver )
44+ public function __construct (ResultDriver $ driver, bool $ normalize = true )
4545 {
4646 $ this ->driver = $ driver ;
47- $ this ->detectTypes ();
47+ if ($ normalize ) {
48+ $ this ->detectTypes ();
49+ }
4850 }
4951
5052
You can’t perform that action at this time.
0 commit comments