Skip to content

Commit f5a28e2

Browse files
committed
fix: code to merge dateFormat values
1 parent 186ece7 commit f5a28e2

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

system/Database/BaseConnection.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -366,16 +366,17 @@ abstract class BaseConnection implements ConnectionInterface
366366
*/
367367
public function __construct(array $params)
368368
{
369+
if (isset($params['dateFormat'])) {
370+
$this->dateFormat = array_merge($this->dateFormat, $params['dateFormat']);
371+
unset($params['dateFormat']);
372+
}
373+
369374
foreach ($params as $key => $value) {
370375
if (property_exists($this, $key)) {
371376
$this->{$key} = $value;
372377
}
373378
}
374379

375-
if (isset($params['dateFormat'])) {
376-
$this->dateFormat = array_merge($this->dateFormat, $params['dateFormat']);
377-
}
378-
379380
$queryClass = str_replace('Connection', 'Query', static::class);
380381

381382
if (class_exists($queryClass)) {

0 commit comments

Comments
 (0)