本文整理汇总了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);
}
示例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());
}
示例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);
}