Skip to content

Commit 48c14cc

Browse files
committed
Add the option "rename_embedded_id_field" in database connection config
1 parent f780906 commit 48c14cc

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
@@ -126,8 +126,6 @@ class Builder extends BaseBuilder
126126
*/
127127
public $options = [];
128128

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

0 commit comments

Comments
 (0)