/** * @param Piwik_ArchiveProcessing_Day $archiveProcessing */ protected function archiveDayRecordInDatabase($archiveProcessing) { $tableCountry = $archiveProcessing->getDataTableFromArray($this->interestByCountry); $archiveProcessing->insertBlobRecord('UserCountry_country', $tableCountry->getSerialized()); $archiveProcessing->insertNumericRecord('UserCountry_distinctCountries', $tableCountry->getRowsCount()); destroy($tableCountry); $tableContinent = $archiveProcessing->getDataTableFromArray($this->interestByContinent); $archiveProcessing->insertBlobRecord('UserCountry_continent', $tableContinent->getSerialized()); destroy($tableContinent); }
/** * @param Piwik_ArchiveProcessing_Day $archiveProcessing */ protected function archiveDayRecordInDatabase($archiveProcessing) { $maximumRows = Piwik_Config::getInstance()->General['datatable_archiving_maximum_rows_standard']; $tableCountry = Piwik_ArchiveProcessing_Day::getDataTableFromArray($this->interestTables['location_country']); $archiveProcessing->insertBlobRecord(self::VISITS_BY_COUNTRY_RECORD_NAME, $tableCountry->getSerialized()); $archiveProcessing->insertNumericRecord(self::DISTINCT_COUNTRIES_METRIC, $tableCountry->getRowsCount()); destroy($tableCountry); $tableRegion = Piwik_ArchiveProcessing_Day::getDataTableFromArray($this->interestTables['location_region']); $serialized = $tableRegion->getSerialized($maximumRows, $maximumRows, Piwik_Archive::INDEX_NB_VISITS); $archiveProcessing->insertBlobRecord(self::VISITS_BY_REGION_RECORD_NAME, $serialized); destroy($tableRegion); $tableCity = Piwik_ArchiveProcessing_Day::getDataTableFromArray($this->interestTables['location_city']); $this->setLatitudeLongitude($tableCity); $serialized = $tableCity->getSerialized($maximumRows, $maximumRows, Piwik_Archive::INDEX_NB_VISITS); $archiveProcessing->insertBlobRecord(self::VISITS_BY_CITY_RECORD_NAME, $serialized); destroy($tableCity); }