@@ -1746,7 +1746,7 @@ protected function batchExecute(string $renderMethod, int $batchSize = 100)
1746
1746
{
1747
1747
if (empty ($ this ->QBSet )) {
1748
1748
if ($ this ->db ->DBDebug ) {
1749
- throw new DatabaseException (' No data availble to process . ' );
1749
+ throw new DatabaseException (trim ( $ renderMethod , ' _ ' ) . ' () has no data . ' );
1750
1750
}
1751
1751
1752
1752
return false ; // @codeCoverageIgnore
@@ -1942,19 +1942,11 @@ protected function getValues(array $values): array
1942
1942
* @param array|string|null $set a dataset or select query
1943
1943
*
1944
1944
* @return false|int|string[] Number of rows inserted or FALSE on failure, SQL array when testMode
1945
- *
1946
- * @throws DatabaseException
1947
1945
*/
1948
1946
public function insertBatch ($ set = null , ?bool $ escape = null , int $ batchSize = 100 )
1949
1947
{
1950
1948
if ($ set !== null && $ set !== []) {
1951
1949
$ this ->setData ($ set , $ escape );
1952
- } elseif (empty ($ this ->QBSet )) {
1953
- if ($ this ->db ->DBDebug ) {
1954
- throw new DatabaseException ('insertBatch() has no data. ' );
1955
- }
1956
-
1957
- return false ; // @codeCoverageIgnore
1958
1950
}
1959
1951
1960
1952
return $ this ->batchExecute ('_insertBatch ' , $ batchSize );
@@ -2286,21 +2278,13 @@ protected function validateUpdate(): bool
2286
2278
* @param array|RawSql|string|null $constraints
2287
2279
*
2288
2280
* @return false|int|string[] Number of rows affected or FALSE on failure, SQL array when testMode
2289
- *
2290
- * @throws DatabaseException
2291
2281
*/
2292
2282
public function updateBatch ($ set = null , $ constraints = null , int $ batchSize = 100 )
2293
2283
{
2294
2284
$ this ->onConstraint ($ constraints );
2295
2285
2296
2286
if ($ set !== null && $ set !== []) {
2297
2287
$ this ->setData ($ set , true );
2298
- } elseif (empty ($ this ->QBSet )) {
2299
- if ($ this ->db ->DBDebug ) {
2300
- throw new DatabaseException ('updateBatch() has no data. ' );
2301
- }
2302
-
2303
- return false ; // @codeCoverageIgnore
2304
2288
}
2305
2289
2306
2290
return $ this ->batchExecute ('_updateBatch ' , $ batchSize );
0 commit comments