@@ -169,7 +169,7 @@ class BaseBuilder
169169 * tableIdentity?: string,
170170 * updateFields?: array,
171171 * constraints?: array,
172- * setQuery ?: string,
172+ * setQueryAsData ?: string,
173173 * sql?: string,
174174 * alias?: string
175175 * }
@@ -1925,9 +1925,9 @@ public function upsert($set = null, ?bool $escape = null)
19251925 */
19261926 public function upsertBatch ($ set = null , ?bool $ escape = null , int $ batchSize = 100 )
19271927 {
1928- $ this ->setQuery ($ set );
1928+ $ this ->setQueryAsData ($ set );
19291929
1930- if (isset ($ this ->QBOptions ['setQuery ' ])) {
1930+ if (isset ($ this ->QBOptions ['setQueryAsData ' ])) {
19311931 $ sql = $ this ->_upsertBatch ($ this ->QBFrom [0 ], $ this ->QBKeys , []);
19321932
19331933 if ($ sql === '' ) {
@@ -1983,8 +1983,8 @@ protected function _upsertBatch(string $table, array $keys, array $values): stri
19831983 $ this ->QBOptions ['sql ' ] = $ sql ;
19841984 }
19851985
1986- if (isset ($ this ->QBOptions ['setQuery ' ])) {
1987- $ data = $ this ->QBOptions ['setQuery ' ];
1986+ if (isset ($ this ->QBOptions ['setQueryAsData ' ])) {
1987+ $ data = $ this ->QBOptions ['setQueryAsData ' ];
19881988 } else {
19891989 $ data = 'VALUES ' . implode (', ' , $ this ->formatValues ($ values )) . "\n" ;
19901990 }
@@ -2092,7 +2092,7 @@ public function onConstraint($set)
20922092 * @param string $alias
20932093 * @param array|string|null $columns an array or comma delimited string of columns
20942094 */
2095- public function setQuery ($ query , $ alias = null , $ columns = null ): BaseBuilder
2095+ public function setQueryAsData ($ query , $ alias = null , $ columns = null ): BaseBuilder
20962096 {
20972097 if (is_string ($ query )) {
20982098 throw new InvalidArgumentException ('$query parameter must be BaseBuilder or RawSql class. ' );
@@ -2124,7 +2124,7 @@ public function setQuery($query, $alias = null, $columns = null): BaseBuilder
21242124 $ columns [$ key ] = $ this ->db ->escapeChar . $ value . $ this ->db ->escapeChar ;
21252125 }
21262126
2127- $ this ->QBOptions ['setQuery ' ] = $ query ;
2127+ $ this ->QBOptions ['setQueryAsData ' ] = $ query ;
21282128 $ this ->QBKeys = $ columns ;
21292129 $ this ->QBSet = [];
21302130 }
@@ -2157,9 +2157,9 @@ protected function formatValues(array $values): array
21572157 */
21582158 public function insertBatch ($ set = null , ?bool $ escape = null , int $ batchSize = 100 )
21592159 {
2160- $ this ->setQuery ($ set );
2160+ $ this ->setQueryAsData ($ set );
21612161
2162- if (isset ($ this ->QBOptions ['setQuery ' ])) {
2162+ if (isset ($ this ->QBOptions ['setQueryAsData ' ])) {
21632163 $ sql = $ this ->_insertBatch ($ this ->QBFrom [0 ], $ this ->QBKeys , []);
21642164
21652165 if ($ sql === '' ) {
@@ -2205,8 +2205,8 @@ protected function _insertBatch(string $table, array $keys, array $values): stri
22052205 $ this ->QBOptions ['sql ' ] = $ sql ;
22062206 }
22072207
2208- if (isset ($ this ->QBOptions ['setQuery ' ])) {
2209- $ data = $ this ->QBOptions ['setQuery ' ];
2208+ if (isset ($ this ->QBOptions ['setQueryAsData ' ])) {
2209+ $ data = $ this ->QBOptions ['setQueryAsData ' ];
22102210 } else {
22112211 $ data = 'VALUES ' . implode (', ' , $ this ->formatValues ($ values ));
22122212 }
@@ -2527,11 +2527,11 @@ protected function validateUpdate(): bool
25272527 */
25282528 public function updateBatch ($ set = null , $ constraints = null , int $ batchSize = 100 )
25292529 {
2530- $ this ->setQuery ($ set );
2530+ $ this ->setQueryAsData ($ set );
25312531
25322532 $ this ->onConstraint ($ constraints );
25332533
2534- if (isset ($ this ->QBOptions ['setQuery ' ])) {
2534+ if (isset ($ this ->QBOptions ['setQueryAsData ' ])) {
25352535 $ sql = $ this ->_updateBatch ($ this ->QBFrom [0 ], $ this ->QBKeys , []);
25362536
25372537 if ($ sql === '' ) {
@@ -2630,8 +2630,8 @@ protected function _updateBatch(string $table, array $keys, array $values): stri
26302630 $ this ->QBOptions ['sql ' ] = $ sql ;
26312631 }
26322632
2633- if (isset ($ this ->QBOptions ['setQuery ' ])) {
2634- $ data = $ this ->QBOptions ['setQuery ' ];
2633+ if (isset ($ this ->QBOptions ['setQueryAsData ' ])) {
2634+ $ data = $ this ->QBOptions ['setQueryAsData ' ];
26352635 } else {
26362636 $ data = implode (
26372637 " UNION ALL \n" ,
@@ -3265,7 +3265,7 @@ protected function isLiteral(string $str): bool
32653265 *
32663266 * @return $this
32673267 */
3268- public function resetQuery ()
3268+ public function resetQueryAsData ()
32693269 {
32703270 $ this ->resetSelect ();
32713271 $ this ->resetWrite ();
@@ -3420,7 +3420,7 @@ protected function setBind(string $key, $value = null, bool $escape = true): str
34203420 */
34213421 protected function cleanClone ()
34223422 {
3423- return (clone $ this )->from ([], true )->resetQuery ();
3423+ return (clone $ this )->from ([], true )->resetQueryAsData ();
34243424 }
34253425
34263426 /**
0 commit comments