當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Period::getId方法代碼示例

本文整理匯總了PHP中Piwik\Period::getId方法的典型用法代碼示例。如果您正苦於以下問題:PHP Period::getId方法的具體用法?PHP Period::getId怎麽用?PHP Period::getId使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Piwik\Period的用法示例。


在下文中一共展示了Period::getId方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getArchiveIdAndVisits

 public static function getArchiveIdAndVisits(Site $site, Period $period, Segment $segment, $minDatetimeArchiveProcessedUTC, $requestedPlugin)
 {
     $dateStart = $period->getDateStart();
     $bindSQL = array($site->getId(), $dateStart->toString('Y-m-d'), $period->getDateEnd()->toString('Y-m-d'), $period->getId());
     $timeStampWhere = '';
     if ($minDatetimeArchiveProcessedUTC) {
         $timeStampWhere = " AND ts_archived >= ? ";
         $bindSQL[] = Date::factory($minDatetimeArchiveProcessedUTC)->getDatetime();
     }
     $pluginOrVisitsSummary = array("VisitsSummary", $requestedPlugin);
     $pluginOrVisitsSummary = array_unique($pluginOrVisitsSummary);
     $sqlWhereArchiveName = self::getNameCondition($pluginOrVisitsSummary, $segment);
     $sqlQuery = "\tSELECT idarchive, value, name, date1 as startDate\n\t\t\t\t\t\tFROM " . ArchiveTableCreator::getNumericTable($dateStart) . "``\n\t\t\t\t\t\tWHERE idsite = ?\n\t\t\t\t\t\t\tAND date1 = ?\n\t\t\t\t\t\t\tAND date2 = ?\n\t\t\t\t\t\t\tAND period = ?\n\t\t\t\t\t\t\tAND ( ({$sqlWhereArchiveName})\n\t\t\t\t\t\t\t\t  OR name = '" . self::NB_VISITS_RECORD_LOOKED_UP . "'\n\t\t\t\t\t\t\t\t  OR name = '" . self::NB_VISITS_CONVERTED_RECORD_LOOKED_UP . "')\n\t\t\t\t\t\t\t{$timeStampWhere}\n\t\t\t\t\t\tORDER BY idarchive DESC";
     $results = Db::fetchAll($sqlQuery, $bindSQL);
     if (empty($results)) {
         return false;
     }
     $idArchive = self::getMostRecentIdArchiveFromResults($segment, $requestedPlugin, $results);
     $idArchiveVisitsSummary = self::getMostRecentIdArchiveFromResults($segment, "VisitsSummary", $results);
     list($visits, $visitsConverted) = self::getVisitsMetricsFromResults($idArchive, $idArchiveVisitsSummary, $results);
     if ($visits === false && $idArchive === false) {
         return false;
     }
     return array($idArchive, $visits, $visitsConverted);
 }
開發者ID:KiwiJuicer,項目名稱:handball-dachau,代碼行數:25,代碼來源:ArchiveSelector.php

示例2: makeLockName

 protected static function makeLockName($idsite, Period $period, Segment $segment)
 {
     $config = Config::getInstance();
     $lockName = 'piwik.' . $config->database['dbname'] . '.' . $config->database['tables_prefix'] . '/' . $idsite . '/' . (!$segment->isEmpty() ? $segment->getHash() . '/' : '') . $period->getId() . '/' . $period->getDateStart()->toString('Y-m-d') . ',' . $period->getDateEnd()->toString('Y-m-d');
     return $lockName . '/' . md5($lockName . SettingsPiwik::getSalt());
 }
開發者ID:KiwiJuicer,項目名稱:handball-dachau,代碼行數:6,代碼來源:ArchiveWriter.php

示例3: getArchiveIdAndVisits

 public function getArchiveIdAndVisits($table, \Piwik\Site $site, \Piwik\Period $period, $minDatetime, $sqlWhereArchiveName)
 {
     $bind = array($site->getId(), $period->getDateStart()->toString('Y-m-d'), $period->getDateEnd()->toString('Y-m-d'), $period->getId());
     if ($minDatetime) {
         $timestampWhere = ' AND ts_archived >= ?';
         $bind[] = Date::factory($minDatetime)->getDatetime();
     } else {
         $timestampWhere = '';
     }
     $startDate = $this->db->quoteIdentifier('startDate');
     $sql = "SELECT idarchive, value, name, date1 AS {$startDate}\n                FROM {$table}\n                WHERE idsite = ?\n                  AND date1 = ?\n                  AND date2 = ?\n                  AND period = ?\n                  AND ( ({$sqlWhereArchiveName})\n                        OR name = '" . ArchiveSelector::NB_VISITS_RECORD_LOOKED_UP . "'\n                        OR name = '" . ArchiveSelector::NB_VISITS_CONVERTED_RECORD_LOOKED_UP . "'\n                     )\n                  {$timestampWhere}\n                ORDER BY idarchive DESC";
     return $this->db->fetchAll($sql, $bind);
 }
開發者ID:FluentDevelopment,項目名稱:piwik,代碼行數:13,代碼來源:Archive.php


注:本文中的Piwik\Period::getId方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。