Piwik\Archive::getArchiveGroupOfPlugin PHP Method

getArchiveGroupOfPlugin() private method

More than one plugin can be called at once when archiving. In such a case we don't want to launch archiving three times for three plugins if doing it once is enough, so getArchiveIds makes sure to get the archive group of all reports. If the period isn't a range, then all plugins' archiving code is executed. If the period is a range, then archiving code is executed individually for each plugin.
private getArchiveGroupOfPlugin ( $plugin )
    private function getArchiveGroupOfPlugin($plugin)
    {
        $periods = $this->params->getPeriods();
        $periodLabel = reset($periods)->getLabel();
        if (Rules::shouldProcessReportsAllPlugins($this->params->getIdSites(), $this->params->getSegment(), $periodLabel)) {
            return self::ARCHIVE_ALL_PLUGINS_FLAG;
        }
        return $plugin;
    }