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