@@ -46,7 +46,7 @@ class BatchRangeIterator implements BatchIteratorInterface
46
46
/**
47
47
* @var int
48
48
*/
49
- private $ currentBatch = 0 ;
49
+ private $ currentOffset = 0 ;
50
50
51
51
/**
52
52
* @var int
@@ -107,7 +107,7 @@ public function __construct(
107
107
public function current ()
108
108
{
109
109
if (null === $ this ->currentSelect ) {
110
- $ this ->isValid = ($ this ->currentBatch + $ this ->batchSize ) < $ this ->totalItemCount ;
110
+ $ this ->isValid = ($ this ->currentOffset + $ this ->batchSize ) < $ this ->totalItemCount ;
111
111
$ this ->currentSelect = $ this ->initSelectObject ();
112
112
}
113
113
return $ this ->currentSelect ;
@@ -138,7 +138,7 @@ public function next()
138
138
if (null === $ this ->currentSelect ) {
139
139
$ this ->current ();
140
140
}
141
- $ this ->isValid = ($ this ->batchSize + $ this ->currentBatch ) < $ this ->totalItemCount ;
141
+ $ this ->isValid = ($ this ->batchSize + $ this ->currentOffset ) < $ this ->totalItemCount ;
142
142
$ select = $ this ->initSelectObject ();
143
143
if ($ this ->isValid ) {
144
144
$ this ->iteration ++;
@@ -201,8 +201,8 @@ private function initSelectObject()
201
201
* Reset sort order section from origin select object
202
202
*/
203
203
$ object ->order ($ this ->correlationName . '. ' . $ this ->rangeField . ' ' . \Magento \Framework \DB \Select::SQL_ASC );
204
- $ object ->limit ($ this ->currentBatch , $ this ->batchSize );
205
- $ this ->currentBatch += $ this ->batchSize ;
204
+ $ object ->limit ($ this ->batchSize , $ this ->currentOffset );
205
+ $ this ->currentOffset += $ this ->batchSize ;
206
206
207
207
return $ object ;
208
208
}
0 commit comments