8383use function trait_exists ;
8484use function var_export ;
8585
86- /** @method Connection getConnection() */
86+ /** @property Connection $connection */
8787class Builder extends BaseBuilder
8888{
8989 private const REGEX_DELIMITERS = ['/ ' , '# ' , '~ ' ];
@@ -1769,7 +1769,7 @@ public function orWhereIntegerNotInRaw($column, $values, $boolean = 'and')
17691769
17701770 private function aliasIdForQuery (array $ values , bool $ root = true ): array
17711771 {
1772- if (array_key_exists ('id ' , $ values ) && ($ root || $ this ->getConnection () ->getRenameEmbeddedIdField ())) {
1772+ if (array_key_exists ('id ' , $ values ) && ($ root || $ this ->connection ->getRenameEmbeddedIdField ())) {
17731773 if (array_key_exists ('_id ' , $ values ) && $ values ['id ' ] !== $ values ['_id ' ]) {
17741774 throw new InvalidArgumentException ('Cannot have both "id" and "_id" fields. ' );
17751775 }
@@ -1796,7 +1796,7 @@ private function aliasIdForQuery(array $values, bool $root = true): array
17961796 }
17971797
17981798 // ".id" subfield are alias for "._id"
1799- if (str_ends_with ($ key , '.id ' ) && ($ root || $ this ->getConnection () ->getRenameEmbeddedIdField ())) {
1799+ if (str_ends_with ($ key , '.id ' ) && ($ root || $ this ->connection ->getRenameEmbeddedIdField ())) {
18001800 $ newkey = substr ($ key , 0 , -3 ) . '._id ' ;
18011801 if (array_key_exists ($ newkey , $ values ) && $ value !== $ values [$ newkey ]) {
18021802 throw new InvalidArgumentException (sprintf ('Cannot have both "%s" and "%s" fields. ' , $ key , $ newkey ));
@@ -1832,7 +1832,7 @@ public function aliasIdForResult(array|object $values, bool $root = true): array
18321832 if (is_array ($ values )) {
18331833 if (
18341834 array_key_exists ('_id ' , $ values ) && ! array_key_exists ('id ' , $ values )
1835- && ($ root || $ this ->getConnection () ->getRenameEmbeddedIdField ())
1835+ && ($ root || $ this ->connection ->getRenameEmbeddedIdField ())
18361836 ) {
18371837 $ values ['id ' ] = $ values ['_id ' ];
18381838 unset($ values ['_id ' ]);
@@ -1851,7 +1851,7 @@ public function aliasIdForResult(array|object $values, bool $root = true): array
18511851 if ($ values instanceof stdClass) {
18521852 if (
18531853 property_exists ($ values , '_id ' ) && ! property_exists ($ values , 'id ' )
1854- && ($ root || $ this ->getConnection () ->getRenameEmbeddedIdField ())
1854+ && ($ root || $ this ->connection ->getRenameEmbeddedIdField ())
18551855 ) {
18561856 $ values ->id = $ values ->_id ;
18571857 unset($ values ->_id );
0 commit comments