Skip to content

Commit f780906

Browse files
committed
Use $connection property
1 parent 3b4ad5a commit f780906

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/Query/Builder.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
use function trait_exists;
8585
use function var_export;
8686

87-
/** @method Connection getConnection() */
87+
/** @property Connection $connection */
8888
class Builder extends BaseBuilder
8989
{
9090
private const REGEX_DELIMITERS = ['/', '#', '~'];
@@ -1770,7 +1770,7 @@ public function orWhereIntegerNotInRaw($column, $values, $boolean = 'and')
17701770

17711771
private function aliasIdForQuery(array $values, bool $root = true): array
17721772
{
1773-
if (array_key_exists('id', $values) && ($root || $this->getConnection()->getRenameEmbeddedIdField())) {
1773+
if (array_key_exists('id', $values) && ($root || $this->connection->getRenameEmbeddedIdField())) {
17741774
if (array_key_exists('_id', $values) && $values['id'] !== $values['_id']) {
17751775
throw new InvalidArgumentException('Cannot have both "id" and "_id" fields.');
17761776
}
@@ -1797,7 +1797,7 @@ private function aliasIdForQuery(array $values, bool $root = true): array
17971797
}
17981798

17991799
// ".id" subfield are alias for "._id"
1800-
if (str_ends_with($key, '.id') && ($root || $this->getConnection()->getRenameEmbeddedIdField())) {
1800+
if (str_ends_with($key, '.id') && ($root || $this->connection->getRenameEmbeddedIdField())) {
18011801
$newkey = substr($key, 0, -3) . '._id';
18021802
if (array_key_exists($newkey, $values) && $value !== $values[$newkey]) {
18031803
throw new InvalidArgumentException(sprintf('Cannot have both "%s" and "%s" fields.', $key, $newkey));
@@ -1833,7 +1833,7 @@ public function aliasIdForResult(array|object $values, bool $root = true): array
18331833
if (is_array($values)) {
18341834
if (
18351835
array_key_exists('_id', $values) && ! array_key_exists('id', $values)
1836-
&& ($root || $this->getConnection()->getRenameEmbeddedIdField())
1836+
&& ($root || $this->connection->getRenameEmbeddedIdField())
18371837
) {
18381838
$values['id'] = $values['_id'];
18391839
unset($values['_id']);
@@ -1852,7 +1852,7 @@ public function aliasIdForResult(array|object $values, bool $root = true): array
18521852
if ($values instanceof stdClass) {
18531853
if (
18541854
property_exists($values, '_id') && ! property_exists($values, 'id')
1855-
&& ($root || $this->getConnection()->getRenameEmbeddedIdField())
1855+
&& ($root || $this->connection->getRenameEmbeddedIdField())
18561856
) {
18571857
$values->id = $values->_id;
18581858
unset($values->_id);

0 commit comments

Comments
 (0)