84
84
use function trait_exists ;
85
85
use function var_export ;
86
86
87
- /** @method Connection getConnection() */
87
+ /** @property Connection $connection */
88
88
class Builder extends BaseBuilder
89
89
{
90
90
private const REGEX_DELIMITERS = ['/ ' , '# ' , '~ ' ];
@@ -1770,7 +1770,7 @@ public function orWhereIntegerNotInRaw($column, $values, $boolean = 'and')
1770
1770
1771
1771
private function aliasIdForQuery (array $ values , bool $ root = true ): array
1772
1772
{
1773
- if (array_key_exists ('id ' , $ values ) && ($ root || $ this ->getConnection () ->getRenameEmbeddedIdField ())) {
1773
+ if (array_key_exists ('id ' , $ values ) && ($ root || $ this ->connection ->getRenameEmbeddedIdField ())) {
1774
1774
if (array_key_exists ('_id ' , $ values ) && $ values ['id ' ] !== $ values ['_id ' ]) {
1775
1775
throw new InvalidArgumentException ('Cannot have both "id" and "_id" fields. ' );
1776
1776
}
@@ -1797,7 +1797,7 @@ private function aliasIdForQuery(array $values, bool $root = true): array
1797
1797
}
1798
1798
1799
1799
// ".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 ())) {
1801
1801
$ newkey = substr ($ key , 0 , -3 ) . '._id ' ;
1802
1802
if (array_key_exists ($ newkey , $ values ) && $ value !== $ values [$ newkey ]) {
1803
1803
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
1833
1833
if (is_array ($ values )) {
1834
1834
if (
1835
1835
array_key_exists ('_id ' , $ values ) && ! array_key_exists ('id ' , $ values )
1836
- && ($ root || $ this ->getConnection () ->getRenameEmbeddedIdField ())
1836
+ && ($ root || $ this ->connection ->getRenameEmbeddedIdField ())
1837
1837
) {
1838
1838
$ values ['id ' ] = $ values ['_id ' ];
1839
1839
unset($ values ['_id ' ]);
@@ -1852,7 +1852,7 @@ public function aliasIdForResult(array|object $values, bool $root = true): array
1852
1852
if ($ values instanceof stdClass) {
1853
1853
if (
1854
1854
property_exists ($ values , '_id ' ) && ! property_exists ($ values , 'id ' )
1855
- && ($ root || $ this ->getConnection () ->getRenameEmbeddedIdField ())
1855
+ && ($ root || $ this ->connection ->getRenameEmbeddedIdField ())
1856
1856
) {
1857
1857
$ values ->id = $ values ->_id ;
1858
1858
unset($ values ->_id );
0 commit comments