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


PHP Campaign::GetErrorMessage方法代码示例

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


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

示例1: Delete

 /**
  * Deletes a layout
  * @param <type> $layoutId
  * @return <type>
  */
 public function Delete($layoutId)
 {
     try {
         $dbh = PDOConnect::init();
         // Make sure the layout id is present
         if ($layoutId == 0) {
             $this->ThrowError(__('No Layout selected'));
         }
         // Untag
         $this->unTagAll($layoutId);
         // Security
         $sth = $dbh->prepare('DELETE FROM lklayoutmediagroup WHERE layoutid = :layoutid');
         $sth->execute(array('layoutid' => $layoutId));
         $sth = $dbh->prepare('DELETE FROM lklayoutregiongroup WHERE layoutid = :layoutid');
         $sth->execute(array('layoutid' => $layoutId));
         // Media Links
         $sth = $dbh->prepare('DELETE FROM lklayoutmedia WHERE layoutid = :layoutid');
         $sth->execute(array('layoutid' => $layoutId));
         // Handle the deletion of the campaign
         $campaign = new Campaign();
         $campaignId = $campaign->GetCampaignId($layoutId);
         // Remove the Campaign (will remove links to this layout - orphaning the layout)
         if (!$campaign->Delete($campaignId)) {
             $this->ThrowError(25008, __('Unable to delete campaign'));
         }
         // Remove the Layout from any display defaults
         $sth = $dbh->prepare('UPDATE `display` SET defaultlayoutid = 4 WHERE defaultlayoutid = :layoutid');
         $sth->execute(array('layoutid' => $layoutId));
         // Remove the Layout from any Campaigns
         if (!$campaign->unlinkAllForLayout($layoutId)) {
             $this->ThrowError($campaign->GetErrorMessage());
         }
         // Remove the Layout (now it is orphaned it can be deleted safely)
         $sth = $dbh->prepare('DELETE FROM layout WHERE layoutid = :layoutid');
         $sth->execute(array('layoutid' => $layoutId));
         return true;
     } catch (Exception $e) {
         Debug::LogEntry('error', $e->getMessage());
         if (!$this->IsError()) {
             $this->SetError(25008, __('Unable to delete layout'));
         }
         return false;
     }
 }
开发者ID:taphier,项目名称:xibo-cms,代码行数:49,代码来源:layout.data.class.php

示例2: Delete

 /**
  * Delete Campaign
  */
 public function Delete()
 {
     // Check the token
     if (!Kit::CheckToken()) {
         trigger_error(__('Sorry the form has expired. Please refresh.'), E_USER_ERROR);
     }
     $db =& $this->db;
     $response = new ResponseManager();
     $campaignId = Kit::GetParam('CampaignID', _POST, _INT);
     // Authenticate this user
     $auth = $this->user->CampaignAuth($campaignId, true);
     if (!$auth->del) {
         trigger_error(__('You do not have permission to delete this campaign'), E_USER_ERROR);
     }
     // Validation
     if ($campaignId == 0 || $campaignId == '') {
         trigger_error(__('Campaign ID is missing'), E_USER_ERROR);
     }
     Kit::ClassLoader('campaign');
     $campaignObject = new Campaign($db);
     if (!$campaignObject->Delete($campaignId)) {
         trigger_error($campaignObject->GetErrorMessage(), E_USER_ERROR);
     }
     $response->SetFormSubmitResponse(__('Campaign Deleted'), false);
     $response->Respond();
 }
开发者ID:fignew,项目名称:xibo-cms,代码行数:29,代码来源:campaign.class.php

示例3: Delete

 /**
  * Delete User
  * @return bool
  */
 public function Delete()
 {
     if (!isset($this->userId) || $this->userId == 0) {
         return $this->SetError(__('Missing userId'));
     }
     try {
         $dbh = PDOConnect::init();
         // Delete all layouts
         $layout = new Layout();
         if (!$layout->deleteAllForUser($this->userId)) {
             return $this->SetError($layout->GetErrorMessage());
         }
         // Delete all Campaigns
         $campaign = new Campaign();
         if (!$campaign->deleteAllForUser($this->userId)) {
             return $this->SetError($campaign->GetErrorMessage());
         }
         // Delete all media
         $media = new Media();
         if (!$media->deleteAllForUser($this->userId)) {
             return $this->SetError($media->GetErrorMessage());
         }
         // Delete all schedules that have not been caught by deleting layouts and campaigns
         // These would be schedules for other peoples layouts
         $schedule = new Schedule();
         if (!$schedule->deleteAllForUser($this->userId)) {
         }
         // Delete the user itself
         $sth = $dbh->prepare('DELETE FROM `user` WHERE userid = :userid');
         $sth->execute(array('userid' => $this->userId));
         // Delete from the session table
         $sth = $dbh->prepare('DELETE FROM `session` WHERE userid = :userid');
         $sth->execute(array('userid' => $this->userId));
         return true;
     } catch (Exception $e) {
         Debug::LogEntry('error', $e->getMessage(), get_class(), __FUNCTION__);
         if (!$this->IsError()) {
             $this->SetError(1, __('Unknown Error'));
         }
         return false;
     }
 }
开发者ID:fignew,项目名称:xibo-cms,代码行数:46,代码来源:userdata.data.class.php


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