Descendants should implement the {@link aggregateDayReport()} and {@link aggregateMultipleReports()}
methods.
Both of these methods should persist analytics data using the {@link \Piwik\ArchiveProcessor}
instance returned by {@link getProcessor()}. The {@link aggregateDayReport()} method should
compute analytics data using the {@link \Piwik\DataAccess\LogAggregator} instance
returned by {@link getLogAggregator()}.
### Examples
**Extending Archiver**
class MyArchiver extends Archiver
{
public function aggregateDayReport()
{
$logAggregator = $this->getLogAggregator();
$data = $logAggregator->queryVisitsByDimension(...);
$dataTable = new DataTable();
$dataTable->addRowsFromSimpleArray($data);
$archiveProcessor = $this->getProcessor();
$archiveProcessor->insertBlobRecords('MyPlugin_myReport', $dataTable->getSerialized(500));
}
public function aggregateMultipleReports()
{
$archiveProcessor = $this->getProcessor();
$archiveProcessor->aggregateDataTableRecords('MyPlugin_myReport', 500);
}
}
function __construct($processor) { parent::__construct($processor); $this->processor = $processor; $this->maximumRowsInDataTableLevelZero = Config::getInstance()->General['datatable_archiving_maximum_rows_custom_variables']; $this->maximumRowsInSubDataTable = Config::getInstance()->General['datatable_archiving_maximum_rows_subtable_custom_variables']; }
public function __construct($processor) { parent::__construct($processor); $this->columnToSortByBeforeTruncation = Metrics::INDEX_NB_VISITS; $this->maximumRowsInDataTable = ArchivingHelper::$maximumRowsInDataTableLevelZero; $this->maximumRowsInSubDataTable = ArchivingHelper::$maximumRowsInSubDataTable; }
function __construct($processor) { parent::__construct($processor); $this->columnToSortByBeforeTruncation = Metrics::INDEX_NB_VISITS; $this->maximumRowsInDataTable = Config::getInstance()->General['datatable_archiving_maximum_rows_events']; $this->maximumRowsInSubDataTable = Config::getInstance()->General['datatable_archiving_maximum_rows_subtable_events']; }
function __construct($processor) { parent::__construct($processor); if ($processor->getParams()->getSite()->isEcommerceEnabled()) { $this->maximumRowsInDataTableLevelZero = self::MAX_ROWS_WHEN_ECOMMERCE; $this->maximumRowsInSubDataTable = self::MAX_ROWS_WHEN_ECOMMERCE; } else { $this->maximumRowsInDataTableLevelZero = Config::getInstance()->General['datatable_archiving_maximum_rows_custom_variables']; $this->maximumRowsInSubDataTable = Config::getInstance()->General['datatable_archiving_maximum_rows_subtable_custom_variables']; } }
public function __construct($processor) { parent::__construct($processor); $this->columnToSortByBeforeTruncation = Metrics::INDEX_NB_VISITS; $this->maximumRowsInDataTableLevelZero = @Config::getInstance()->General['datatable_archiving_maximum_rows_referers']; $this->maximumRowsInSubDataTable = @Config::getInstance()->General['datatable_archiving_maximum_rows_subtable_referers']; if (empty($this->maximumRowsInDataTableLevelZero)) { $this->maximumRowsInDataTableLevelZero = Config::getInstance()->General['datatable_archiving_maximum_rows_referrers']; $this->maximumRowsInSubDataTable = Config::getInstance()->General['datatable_archiving_maximum_rows_subtable_referrers']; } }
function __construct($processor) { parent::__construct($processor); $this->isSiteSearchEnabled = $processor->getParams()->getSite()->isSiteSearchEnabled(); }
function __construct($processor) { parent::__construct($processor); $this->maximumRowsInDataTableLevelZero = Config::getInstance()->General['datatable_archiving_maximum_rows_userid_users']; }