本文整理汇总了PHP中myPartnerUtils::collectPartnerMonthlyStatisticsFromDWH方法的典型用法代码示例。如果您正苦于以下问题:PHP myPartnerUtils::collectPartnerMonthlyStatisticsFromDWH方法的具体用法?PHP myPartnerUtils::collectPartnerMonthlyStatisticsFromDWH怎么用?PHP myPartnerUtils::collectPartnerMonthlyStatisticsFromDWH使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类myPartnerUtils
的用法示例。
在下文中一共展示了myPartnerUtils::collectPartnerMonthlyStatisticsFromDWH方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: doMonthlyPartnerUsage
public static function doMonthlyPartnerUsage(Partner $partner)
{
KalturaLog::debug("Validating partner [" . $partner->getId() . "]");
$packages = new PartnerPackages();
$partnerPackage = $packages->getPackageDetails($partner->getPartnerPackage());
if ($partnerPackage[PartnerPackages::PACKAGE_CYCLE_FEE] != 0) {
KalturaLog::debug("Partner has paid package, skipping validation [" . $partner->getId() . "]");
return;
}
$block_notification_grace = time() - dateUtils::DAY * self::BLOCKING_DAYS_GRACE;
$delete_grace = time() - dateUtils::DAY * 30;
$report_date = dateUtils::todayOffset(-1);
list($monthlyStorage, $monthlyTraffic, $monthlyTranscoding) = myPartnerUtils::collectPartnerMonthlyStatisticsFromDWH($partner, $report_date);
$email_link_hash = 'pid=' . $partner->getId() . '&h=' . self::getEmailLinkHash($partner->getId(), $partner->getSecret());
self::validatePartnerMonthlyUsagePerType($partner, $partnerPackage, $monthlyStorage, PartnerPackages::PACKAGE_STORAGE_USAGE, $report_date, $block_notification_grace, $delete_grace, $email_link_hash);
self::validatePartnerMonthlyUsagePerType($partner, $partnerPackage, $monthlyTraffic, PartnerPackages::PACKAGE_TRAFFIC_USAGE, $report_date, $block_notification_grace, $delete_grace, $email_link_hash);
self::validatePartnerMonthlyUsagePerType($partner, $partnerPackage, $monthlyTranscoding, PartnerPackages::PACKAGE_TRANSCODING_USAGE, $report_date, $block_notification_grace, $delete_grace, $email_link_hash);
$partner->save();
}