Skip to content

Commit 1e4b1c0

Browse files
committed
Add the option "rename_embedded_id_field" in database connection config
1 parent ca43fff commit 1e4b1c0

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Diff for: src/Connection.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class Connection extends BaseConnection
5454
private ?CommandSubscriber $commandSubscriber = null;
5555

5656
/** @var bool Whether to rename the rename "id" into "_id" for embedded documents. */
57-
private bool $renameEmbeddedIdField = true;
57+
private bool $renameEmbeddedIdField;
5858

5959
/**
6060
* Create a new database connection instance.
@@ -83,6 +83,8 @@ public function __construct(array $config)
8383
$this->useDefaultSchemaGrammar();
8484

8585
$this->useDefaultQueryGrammar();
86+
87+
$this->renameEmbeddedIdField = $config['rename_embedded_id_field'] ?? true;
8688
}
8789

8890
/**

Diff for: src/Query/Builder.php

-2
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,6 @@ class Builder extends BaseBuilder
125125
*/
126126
public $options = [];
127127

128-
private ?bool $renameEmbeddedIdField;
129-
130128
/**
131129
* All of the available clause operators.
132130
*

0 commit comments

Comments
 (0)