当前位置: 首页>>代码示例>>PHP>>正文


PHP OA_Dal::noDateString方法代码示例

本文整理汇总了PHP中OA_Dal::noDateString方法的典型用法代码示例。如果您正苦于以下问题:PHP OA_Dal::noDateString方法的具体用法?PHP OA_Dal::noDateString怎么用?PHP OA_Dal::noDateString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在OA_Dal的用法示例。


在下文中一共展示了OA_Dal::noDateString方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: _runReports

 /**
  * A method to send the "midnight" reports during maintenance - that
  * is, the delivery information report, showing what the campaign(s)
  * have delivered since the last time the report was sendt.
  *
  * @access private
  */
 function _runReports()
 {
     OA::debug('  Starting to send advertiser "campaign delivery" reports.', PEAR_LOG_DEBUG);
     // Get all advertisers where the advertiser preference is to send reports
     OA::debug('   - Getting details of advertisers that require reports to be sent.', PEAR_LOG_DEBUG);
     $doClients = OA_Dal::factoryDO('clients');
     $doClients->report = 't';
     $doClients->find();
     while ($doClients->fetch()) {
         $aAdvertiser = $doClients->toArray();
         // Don't email report by default
         $sendReport = false;
         // Has the report interval date been passed?
         if ($aAdvertiser['reportlastdate'] == OA_Dal::noDateString()) {
             $sendReport = true;
             $oReportLastDate = null;
         } else {
             $oNowDate = new Date();
             $oReportLastDate = new Date($aAdvertiser['reportlastdate']);
             $oSpan = new Date_Span();
             $oSpan->setFromDateDiff($oReportLastDate, $oNowDate);
             $daysSinceLastReport = (int) floor($oSpan->toDays());
             if ($daysSinceLastReport >= $aAdvertiser['reportinterval']) {
                 $sendReport = true;
             }
         }
         if ($sendReport) {
             // Send the advertiser's campaign delivery report
             $oEmail = new OA_Email();
             $oEmail->sendCampaignDeliveryEmail($aAdvertiser, $oReportLastDate);
         }
     }
     OA::debug('  Finished sending advertiser "campaign delivery" reports.', PEAR_LOG_DEBUG);
 }
开发者ID:villos,项目名称:tree_admin,代码行数:41,代码来源:Maintenance.php

示例2: OX_Maintenance_Priority_Campaign

 /**
  * The class constructor method.
  *
  * @param array $aParams An associative array of values to be assigned to
  *                       the object. Valid array keys are:
  *      'campaignid' or 'placement_id'                   -> The placement ID. Required!
  *      'activate'                                       -> The activation date of the placement in
  *                                                          'YYYY-MM-DD' string format
  *      'expire'                                         -> The expiration date of the placement in
  *                                                          'YYYY-MM-DD' string format
  *      'views' or 'impression_target_total'             -> The placement lifetime impression target
  *      'clicks' or 'click_target_total'                 -> The placement lifetime click target
  *      'conversions' or 'conversion_target_total'       -> The placement lifetime conversion target
  *      'target_impression' or 'impression_target_daily' -> The dail impression target
  *      'target_click' or 'click_target_daily'           -> The daily click target
  *      'target_conversion' or 'conversion_target_daily' -> The daily conversion target
  *      'priority'                                       -> The placement priority
  */
 function OX_Maintenance_Priority_Campaign($aParams)
 {
     // Convert "old" input value names to "new", if required
     foreach ($this->aNewOldTypes as $newName => $oldName) {
         if (empty($aParams[$newName])) {
             $aParams[$newName] = $aParams[$oldName];
         }
     }
     // Test the input values
     $valid = true;
     if (!is_array($aParams)) {
         $valid = false;
     }
     if (count($aParams) < 0) {
         $valid = false;
     }
     if (!is_numeric($aParams['placement_id'])) {
         $valid = false;
     }
     if (!$valid) {
         $this->_abort();
     }
     // Store the required supplied values
     $this->id = (int) $aParams['placement_id'];
     // Store the optional required values
     $this->activate = !empty($aParams['activate']) && $aParams['activate'] != OA_Dal::noDateString() ? $aParams['activate'] : OA_Dal::noDateValue();
     $this->expire = !empty($aParams['expire']) && $aParams['expire'] != OA_Dal::noDateString() ? $aParams['expire'] : OA_Dal::noDateValue();
     $this->impressionTargetTotal = isset($aParams['impression_target_total']) ? (int) $aParams['impression_target_total'] : 0;
     $this->clickTargetTotal = isset($aParams['click_target_total']) ? (int) $aParams['click_target_total'] : 0;
     $this->conversionTargetTotal = isset($aParams['conversion_target_total']) ? (int) $aParams['conversion_target_total'] : 0;
     $this->impressionTargetDaily = isset($aParams['impression_target_daily']) ? (int) $aParams['impression_target_daily'] : 0;
     $this->clickTargetDaily = isset($aParams['click_target_daily']) ? (int) $aParams['click_target_daily'] : 0;
     $this->conversionTargetDaily = isset($aParams['conversion_target_daily']) ? (int) $aParams['conversion_target_daily'] : 0;
     $this->priority = isset($aParams['priority']) ? (int) $aParams['priority'] : 0;
     // Set the object's data access layer objects
     $this->oMaxDalEntities =& $this->_getMAX_Dal_Entities();
     $this->oMaxDalMaintenancePriority =& $this->_getOA_Dal_Maintenance_Priority();
 }
开发者ID:villos,项目名称:tree_admin,代码行数:56,代码来源:Campaign.php


注:本文中的OA_Dal::noDateString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。