本文整理汇总了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;
}
}
示例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();
}
示例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;
}
}