当前位置: 首页>>代码示例>>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;未经允许,请勿转载。