public function process($taskId, $campaignId, $startTime, $lastSent, $startId = null, $endId = null) { $this->resetPointer(); while ($data = $this->getBatch()) { Defero::pushMessageBatch($campaignId, $data); if (count($data) < $this->_batchSize) { // don't search for more if the last batch was not full break; } } }