Example #1
0
 /**
  * Deletes by batches Archive IDs in the specified month,
  *
  * @param Date $date
  * @param $idArchivesToDelete
  * @return int Number of rows deleted from both numeric + blob table.
  */
 protected function deleteArchiveIds(Date $date, $idArchivesToDelete)
 {
     $batches = array_chunk($idArchivesToDelete, 1000);
     $numericTable = ArchiveTableCreator::getNumericTable($date);
     $blobTable = ArchiveTableCreator::getBlobTable($date);
     $deletedCount = 0;
     foreach ($batches as $idsToDelete) {
         $deletedCount += $this->model->deleteArchiveIds($numericTable, $blobTable, $idsToDelete);
     }
     return $deletedCount;
 }