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


PHP Display::NotifyDisplays方法代码示例

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


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

示例1: UpdateWatermark

 /**
  * Update the Water Mark to indicate the last data edit
  * @param int $dataSetId The Data Set ID to Update
  */
 private function UpdateWatermark($dataSetId)
 {
     if ($dataSetId == 0 || $dataSetId == '') {
         return $this->SetError(25001, __('Missing dataSetId'));
     }
     if (!$this->updateWatermark) {
         return;
     }
     Debug::LogEntry('audit', sprintf('Updating water mark on DataSetId: %d', $dataSetId), 'DataSetData', 'UpdateWatermark');
     try {
         $dbh = PDOConnect::init();
         $sth = $dbh->prepare('UPDATE `dataset` SET LastDataEdit = :last_data_edit WHERE DataSetID = :dataset_id');
         $sth->execute(array('last_data_edit' => time(), 'dataset_id' => $dataSetId));
         // Get affected Campaigns
         Kit::ClassLoader('dataset');
         $dataSet = new DataSet($this->db);
         $campaigns = $dataSet->GetCampaignsForDataSet($dataSetId);
         Kit::ClassLoader('display');
         $display = new Display($this->db);
         foreach ($campaigns as $campaignId) {
             // Assess all displays
             $campaigns = $display->NotifyDisplays($campaignId);
         }
     } catch (Exception $e) {
         Debug::LogEntry('error', $e->getMessage());
         if (!$this->IsError()) {
             $this->SetError(1, __('Unknown Error'));
         }
         return false;
     }
 }
开发者ID:ajiwo,项目名称:xibo-cms,代码行数:35,代码来源:datasetdata.data.class.php

示例2: SetLayoutXml

 /**
  * Sets the Layout Xml and writes it back to the database
  * @return
  * @param $layoutid Object
  * @param $xml Object
  */
 public function SetLayoutXml($layoutid, $xml)
 {
     Debug::LogEntry('audit', 'IN', 'Layout', 'SetLayoutXml');
     try {
         $dbh = PDOConnect::init();
         $sth = $dbh->prepare('UPDATE layout SET xml = :xml, modifieddt = NOW() WHERE layoutID = :layoutid');
         $sth->execute(array('layoutid' => $layoutid, 'xml' => $xml));
         // Get the Campaign ID
         $campaign = new Campaign($this->db);
         $campaignId = $campaign->GetCampaignId($layoutid);
         // Notify (dont error)
         if (!$this->delayFinalise) {
             $displayObject = new Display($this->db);
             $displayObject->NotifyDisplays($campaignId);
         }
         Debug::LogEntry('audit', 'OUT', 'Layout', 'SetLayoutXml');
         return true;
     } catch (Exception $e) {
         Debug::LogEntry('error', $e->getMessage());
         if (!$this->IsError()) {
             $this->SetError(25007, 'Unable to Update Layout.');
         }
         return false;
     }
 }
开发者ID:taphier,项目名称:xibo-cms,代码行数:31,代码来源:layout.data.class.php

示例3: Add


//.........这里部分代码省略.........
         // Validation
         if (count($displayGroupIDs) == 0) {
             return $this->SetError(25001, __('No display groups selected'));
         }
         if ($userID == 0) {
             return $this->SetError(25001, __('No User Id Present'));
         }
         // Cant have a 0 increment as it creates a loop
         if ($recDetail == 0) {
             $recDetail = 1;
         }
         // make the displayid_list from the selected displays.
         $displayGroupIDList = implode(",", $displayGroupIDs);
         // Parameters for the query
         $params = array('campaignid' => $campaignId, 'displaygroupids' => $displayGroupIDList, 'userid' => $userID, 'is_priority' => $isPriority, 'fromdt' => $fromDT, 'todt' => $toDT);
         $SQL = "";
         $SQL .= "INSERT INTO `schedule` (CampaignId, DisplayGroupIDs, userID, is_priority, FromDT, ToDT ";
         // Columns for Recurrence
         if ($recType != '' && $recType != 'null') {
             $SQL .= ", recurrence_type, recurrence_detail, recurrence_range ";
         }
         $SQL .= ") ";
         $SQL .= " VALUES ( :campaignid, :displaygroupids, :userid, :is_priority, :fromdt, :todt ";
         // Values for Recurrence
         if ($recType != '' && $recType != 'null') {
             $SQL .= ", :recurrence_type, :recurrence_detail, :recurrence_range ";
             $params['recurrence_type'] = $recType;
             $params['recurrence_detail'] = $recDetail;
             $params['recurrence_range'] = $recToDT;
         }
         $SQL .= ")";
         $sth = $dbh->prepare($SQL);
         $sth->execute($params);
         // Get the event id
         $eventID = $dbh->lastInsertId();
         // Make sure we dont just have one...
         if (!is_array($displayGroupIDs)) {
             $displayGroupIDs = array($displayGroupIDs);
         }
         // Create a detail record for each display group
         foreach ($displayGroupIDs as $displayGroupID) {
             // Add the parent detail record for this event
             if (!$this->AddDetail($displayGroupID, $campaignId, $fromDT, $toDT, $userID, $isPriority, $eventID, $displayOrder)) {
                 throw new Exception("Error Processing Request", 1);
             }
             // Is there any recurrance to take care of?
             if ($recType != '' && $recType != 'null') {
                 // Set the temp starts
                 $t_start_temp = $fromDT;
                 $t_end_temp = $toDT;
                 Debug::LogEntry('audit', sprintf('Recurrence detected until %d. Recurrence period is %s and interval is %s.', $recToDT, $recDetail, $recType), 'Schedule', 'Add');
                 //loop until we have added the recurring events for the schedule
                 while ($t_start_temp < $recToDT) {
                     // add the appropriate time to the start and end
                     switch ($recType) {
                         case 'Hour':
                             $t_start_temp = mktime(date("H", $t_start_temp) + $recDetail, date("i", $t_start_temp), date("s", $t_start_temp), date("m", $t_start_temp), date("d", $t_start_temp), date("Y", $t_start_temp));
                             $t_end_temp = mktime(date("H", $t_end_temp) + $recDetail, date("i", $t_end_temp), date("s", $t_end_temp), date("m", $t_end_temp), date("d", $t_end_temp), date("Y", $t_end_temp));
                             break;
                         case 'Day':
                             $t_start_temp = mktime(date("H", $t_start_temp), date("i", $t_start_temp), date("s", $t_start_temp), date("m", $t_start_temp), date("d", $t_start_temp) + $recDetail, date("Y", $t_start_temp));
                             $t_end_temp = mktime(date("H", $t_end_temp), date("i", $t_end_temp), date("s", $t_end_temp), date("m", $t_end_temp), date("d", $t_end_temp) + $recDetail, date("Y", $t_end_temp));
                             break;
                         case 'Week':
                             $t_start_temp = mktime(date("H", $t_start_temp), date("i", $t_start_temp), date("s", $t_start_temp), date("m", $t_start_temp), date("d", $t_start_temp) + $recDetail * 7, date("Y", $t_start_temp));
                             $t_end_temp = mktime(date("H", $t_end_temp), date("i", $t_end_temp), date("s", $t_end_temp), date("m", $t_end_temp), date("d", $t_end_temp) + $recDetail * 7, date("Y", $t_end_temp));
                             break;
                         case 'Month':
                             $t_start_temp = mktime(date("H", $t_start_temp), date("i", $t_start_temp), date("s", $t_start_temp), date("m", $t_start_temp) + $recDetail, date("d", $t_start_temp), date("Y", $t_start_temp));
                             $t_end_temp = mktime(date("H", $t_end_temp), date("i", $t_end_temp), date("s", $t_end_temp), date("m", $t_end_temp) + $recDetail, date("d", $t_end_temp), date("Y", $t_end_temp));
                             break;
                         case 'Year':
                             $t_start_temp = mktime(date("H", $t_start_temp), date("i", $t_start_temp), date("s", $t_start_temp), date("m", $t_start_temp), date("d", $t_start_temp), date("Y", $t_start_temp) + $recDetail);
                             $t_end_temp = mktime(date("H", $t_end_temp), date("i", $t_end_temp), date("s", $t_end_temp), date("m", $t_end_temp), date("d", $t_end_temp), date("Y", $t_end_temp) + $recDetail);
                             break;
                     }
                     // after we have added the appropriate amount, are we still valid
                     if ($t_start_temp > $recToDT) {
                         break;
                     }
                     if (!$this->AddDetail($displayGroupID, $campaignId, $t_start_temp, $t_end_temp, $userID, $isPriority, $eventID, $displayOrder)) {
                         throw new Exception("Error Processing Request", 1);
                     }
                 }
             }
         }
         // Notify (dont error)
         Kit::ClassLoader('Display');
         $displayObject = new Display($this->db);
         $displayObject->NotifyDisplays($campaignId);
         Debug::LogEntry('audit', 'OUT', 'Schedule', 'Add');
         return true;
     } catch (Exception $e) {
         Debug::LogEntry('error', $e->getMessage());
         if (!$this->IsError()) {
             $this->SetError(25001, __('Could not INSERT a new Schedule'));
         }
         return false;
     }
 }
开发者ID:abbeet,项目名称:server39,代码行数:101,代码来源:schedule.data.class.php


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