/** * Whether the specified plugin's reports should be archived * @param string $pluginName * @return bool */ protected function shouldProcessReportsForPlugin($pluginName) { if ($this->params->getRequestedPlugin() == $pluginName) { return true; } if (Rules::shouldProcessReportsAllPlugins($this->params->getIdSites(), $this->params->getSegment(), $this->params->getPeriod()->getLabel())) { return true; } if (!\Piwik\Plugin\Manager::getInstance()->isPluginLoaded($this->params->getRequestedPlugin())) { return true; } return false; }
/** * Constructor. * * @param \Piwik\ArchiveProcessor\Parameters $params */ public function __construct(Parameters $params) { $this->dateStart = $params->getDateStart(); $this->dateEnd = $params->getDateEnd(); $this->segment = $params->getSegment(); $this->sites = $params->getIdSites(); }
protected function getArchive() { if (empty($this->archive)) { $subPeriods = $this->params->getSubPeriods(); $idSites = $this->params->getIdSites(); $this->archive = Archive::factory($this->params->getSegment(), $subPeriods, $idSites); } return $this->archive; }
protected function doesRequestedPluginIncludeVisitsSummary() { $processAllReportsIncludingVisitsSummary = Rules::shouldProcessReportsAllPlugins($this->params->getIdSites(), $this->params->getSegment(), $this->params->getPeriod()->getLabel()); $doesRequestedPluginIncludeVisitsSummary = $processAllReportsIncludingVisitsSummary || $this->params->getRequestedPlugin() == 'VisitsSummary'; return $doesRequestedPluginIncludeVisitsSummary; }