コード例 #1
0
ファイル: Archive.php プロジェクト: carriercomm/piwik
 /**
  * Returns an array describing what metadata to use when indexing a query result.
  * For use with DataCollection.
  *
  * @return array
  */
 private function getResultIndices()
 {
     $indices = array();
     if (count($this->params->getIdSites()) > 1 || $this->forceIndexedBySite) {
         $indices['site'] = 'idSite';
     }
     if (count($this->params->getPeriods()) > 1 || $this->forceIndexedByDate) {
         $indices['period'] = 'date';
     }
     return $indices;
 }
コード例 #2
0
ファイル: Archive.php プロジェクト: sebastianpiskorski/piwik
 /**
  * Returns the archiving group identifier given a plugin.
  *
  * 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 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;
 }