本文整理汇总了PHP中Piwik\DataAccess\ArchiveTableCreator::getTableMonthFromDate方法的典型用法代码示例。如果您正苦于以下问题:PHP ArchiveTableCreator::getTableMonthFromDate方法的具体用法?PHP ArchiveTableCreator::getTableMonthFromDate怎么用?PHP ArchiveTableCreator::getTableMonthFromDate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Piwik\DataAccess\ArchiveTableCreator
的用法示例。
在下文中一共展示了ArchiveTableCreator::getTableMonthFromDate方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getLastNTableMonths
/**
* @param int $lastN
* @return string[]
*/
private function getLastNTableMonths($lastN)
{
$now = Date::factory('now');
$result = array();
for ($i = 0; $i < $lastN; ++$i) {
$date = $now->subMonth($i + 1);
$result[] = ArchiveTableCreator::getTableMonthFromDate($date);
}
return $result;
}
示例2: getDatesByYearMonthAndPeriodType
/**
* Called when deleting all periods.
*
* @param Date[] $dates
* @return string[][][]
*/
private function getDatesByYearMonthAndPeriodType($dates)
{
$result = array();
foreach ($dates as $date) {
$yearMonth = ArchiveTableCreator::getTableMonthFromDate($date);
$result[$yearMonth][null][] = $date->toString();
// since we're removing all periods, we must make sure to remove year periods as well.
// this means we have to make sure the january table is processed.
$janYearMonth = $date->toString('Y') . '_01';
$result[$janYearMonth][null][] = $date->toString();
}
return $result;
}