diff options
author | mattab <matthieu.aubry@gmail.com> | 2013-07-01 14:50:02 +0400 |
---|---|---|
committer | mattab <matthieu.aubry@gmail.com> | 2013-07-01 14:50:02 +0400 |
commit | 8cf610d7a749dd21e66b0622e99f9cf59ee23f7f (patch) | |
tree | f40b92f4d7e8488c20ea39fb1337daf5ad6aa68f /core | |
parent | 13f2d74525d28e9a2f9464dc00aaa58a49ac08fb (diff) |
Reverting broken commit
Diffstat (limited to 'core')
-rw-r--r-- | core/DataAccess/ArchiveSelector.php | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/core/DataAccess/ArchiveSelector.php b/core/DataAccess/ArchiveSelector.php index 5cdb02b51b..b61a3a3330 100644 --- a/core/DataAccess/ArchiveSelector.php +++ b/core/DataAccess/ArchiveSelector.php @@ -282,39 +282,6 @@ class Piwik_DataAccess_ArchiveSelector . $dateStart->toString("Y-m") ." ] [Deleted IDs: " . implode (',', $idArchivesToDelete) . "]"); } - public function deleteArchives($idSites, $datesByYearMonth) - { - // In each table, invalidate day/week/month/year containing this date - $sqlIdSites = implode(",", $idSites); - $archiveTables = Piwik_DataAccess_ArchiveTableCreator::getTablesArchivesInstalled(); - foreach ($archiveTables as $table) { - // Extract Y_m from table name - $monthYear = Piwik_DataAccess_ArchiveTableCreator::getDateFromTableName($table); - if (!isset($datesByYearMonth[$monthYear])) { - continue; - } - // Dates which are to be deleted from this table - $datesToDeleteInTable = $datesByYearMonth[$monthYear]; - - // Build one statement to delete all dates from the given table - $sql = $bind = array(); - $datesToDeleteInTable = array_unique($datesToDeleteInTable); - foreach ($datesToDeleteInTable as $dateToDelete) { - $sql[] = '(date1 <= ? AND ? <= date2)'; - $bind[] = $dateToDelete; - $bind[] = $dateToDelete; - } - $sql = implode(" OR ", $sql); - - $query = "DELETE FROM $table " . - " WHERE ( $sql ) " . - " AND idsite IN (" . $sqlIdSites . ")"; - Piwik_Query($query, $bind); - } - return true; - } - - /* * Deleting "Custom Date Range" reports after 1 day, since they can be re-processed and would take up un-necessary space */ |