Пример #1
0
 /**
  *
  */
 private function addSubmissions($update_download_id = false)
 {
     if ($update_download_id) {
         $total = $this->formsRepository->getSubmissions($this->form->id, false, false, $this->date_range_from, $this->date_range_to, true);
         $this->formsRepository->updateDownloadPercentage($update_download_id, 0);
     }
     $offset = 0;
     $limit = 100;
     while (true) {
         if ($this->loopSubmissions($offset, $limit)) {
             break;
         }
         if (isset($total)) {
             $percentage = ($offset + $limit) / $total * 100;
             $this->formsRepository->updateDownloadPercentage($update_download_id, $percentage);
         }
         $offset += $limit;
     }
 }